Billboard using ofNode

I don’t know if this is the ideal way to do this, but I recently had to do billboarding (always facing the camera) of objects inside an ofCamera rotation and found that ofNode::lookAt is pretty helpful here if you want to figure out how to rotate things to always face the camera – thought it might be helpful to post this gist up

some billboarded 3d objects, rotated slightly so you can see they are cubes. (if you comment out the ofRotate(30, 1,1,0); line, they look like squares since they always face the camera directly!)

again, there might be a faster / smarter way of doing this, but I found ofNode super helpful for things like this.

5 Likes