Z location / translation

hi all
just moved to OF from processing and loving it. trying to get my head around how OF deals with 3D space. are the gl functions the only ones that deal with the z-axis at the moment?

i am currently working on an array of images that move around in 3D space and have been using the gl translate functions to draw images on the Z axis. the problem with this is that they don’t display correctly in relation to each other. For example, an image in the distance will overlap a closer one if its draw function is called more recently. are there any workarounds for this?

if there are no OF 3D modes yet, are there any other gl functions that could help me, or do i need to fake it and use scale or glTranslate while paying attention to the order i draw the images in.

any advice hugely appreciated,


you can also try using glEnable(GL_DEPTH_TEST)

see http://www.opengl.org/documentation/spe-…-nable.html for more info.


works! thanks jeremy - couldn’t be easier.
a lot of other potentially handy info in that link too.

but i am just realising now that i may have to fake the 3d with scale anyway. I’m planning to span this scene across multiple projectors/computers, with one osc server sending the co-ords to a few osc clients to render their piece of the scene. they will basically each have the same app but will translate the main view to choose which piece of the scene they show. if each projector has it’s own z-axis vanishing point it won’t sync up right.

the projectors will be configured in a circle so i think it’s my only option for this project, although if they were in a straight line i wonder if there would be another way. some way to use translate to crop, but specify the location/direction of the main viewpoint?