Drawing inside an ofCamera

Hello

Lets see if i can explain myself right, im trying to do 3d particle system, and want to keep the particles moving inside the screen area.

When i do in 2d i can constrain the particles to be inside the screen because i know that maxLeft is 0 maxRight is ofGetWidth() top is 0 and bottom is ofGetHeight()

But when i apply an ofCamera and position that camera in the center of the screen, what coordinates are my bounds? I tried to apply the same bounds as in 2d but do not work.

I mean, when drawing inside an ofCamera positioned in the middle of the screen. The center of the screen is still (ofGetWith()/2, ofGetHeight()/2) ??? and maxRIght is ofGetWidth(), maxLeft is 0 and etc etc ??

Thank you

Hi, if I understand you correctly, what you need to use as the bounds is the camera frustum.
Look at this example as it actually shows how to achieve it
Cheers

Thank you, thats what i wanted to know!

1 Like