Drawing a sphere off-centre with a straight-on view

Hi all,

I am attempting to position an ofSpherePrimitive in various places in 2D space on the screen without it changing the appearance of it’s orientation at an orientation of 0,0,0. In other words, I am attempting to draw a sphere off-centre on the screen but with the ‘front’ of the sphere still facing forwards.

For example, if I draw the sphere (with it’s axes displayed) in the centre of the screen the Z / blue axis will point directly towards me at an orientation of 0,0,0. However, understandably, if I draw the sphere away from the centre point the Z axis will be pointing at an angle away from me at an orientation of 0,0,0.

How can implement it so the sphere always faces forwards no matter what the position in 2D space?

My first guess was that it could be done using an ofCamera, positioning the camera so that the sphere is drawn in the centre of it’s view, but I’m having no luck with this approach.

Many thanks in advance.

using an orthographic camera will have that kind of effect

Thanks - enableOrtho() is all I was missing!

1 Like