We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › P3D camera vs OPENGL camera
Page Index Toggle Pages: 1
P3D camera vs OPENGL camera (Read 1910 times)
P3D camera vs OPENGL camera
Dec 1st, 2009, 4:59am
 
hi guys, hope you are all right.

for some reason, in my MyCamera() class, the movement of the camera goes wild when i use P3D, and with OPENGL does not. i use UP and DOWN keys to increment eyeY and centerY at the same time, to move camera along Y axis, it's a very simple thing really, but, for some reason, past y=200 everything in my sketch goes crazy. no , it has nothing to do with vars messing with each other, everything is built with classes, using local vars. it hapens only with the Y axis. if i change the render mode to OPENGL, every thing goes ok. i'm trying to undestand what is happening, but with no luck. it's the first time i see this, even in other sketchs where i use the same 'modus operandis' that problem doesn't occur.

i apreciate some documentation about P3D and OPENGL, I'd realy would like to understand this.
Re: P3D camera vs OPENGL camera
Reply #1 - Dec 1st, 2009, 5:45am
 
whenever i see anything go crazy i think 'clipping'. either the camera's inside something or it's outside the view frustum.

what does your camera command look like? you can work out the view frustum from that.

can you post code, or pics?
Re: P3D camera vs OPENGL camera
Reply #2 - Dec 1st, 2009, 9:11am
 
trying to post one more time....

here is the applet, press the UP key all the way UP, and see... the end of the world.

http://www.maxtrix.com.pt/processing/camera_1/

by the way, are axis ok? Y goes up(+) and down(-), X goes left(-) and right(+) but... isn't Z wrong?? Z(-) goes up and Z(+) goes down, shouldn't be the other  way? even my camera upZ is set on 1 (postive value) but Z axis points the oposite way.

i had few posts so i couldn't post the link to the applet....  Cry
Re: P3D camera vs OPENGL camera
Reply #3 - Dec 1st, 2009, 10:16am
 
your camera has z as up (last 3 parameters to camera). which is a bit odd (i normally have y as up / down, z as in / out, the opengl way). but i don't think that's the problem.

i will have a look at it when i get home (a couple of hours) as i can't really do much here at work. but i *think* it's to do with your terrain, that the shape that suddenly appears is always there but is behind you until y < 200.

try moving the camera outwards so you can see more of the scene.
Re: P3D camera vs OPENGL camera
Reply #4 - Dec 1st, 2009, 10:30am
 
i'm changing my coords to fit this:

http://processing.org/reference/environment/index.html#Coordinates

which , i must say it's a little bizare to me. never saw 3D axis like this, usually Y goes up, X goes right and Z goes the viewer direction, like going out the screen. it's normal in CAD software... i think. but probabily you're right, that's not the problem, i think the same.

i tried not to render the terrain, only the axis, but the same happens.

after changing the coord system:

http://www.maxtrix.com.pt/processing/camera_2/

the same thing happens, but now in Z axis, not Y anymore.

after changing the terrain position, i start to think the problem is in the far end of the terrain    Cry

http://www.maxtrix.com.pt/processing/camera_3/
Re: P3D camera vs OPENGL camera
Reply #5 - Dec 1st, 2009, 12:53pm
 
i tried everything....
one thing i'm sure, camera eyeZ crossing 0 (zero) position goes mad.

made lots of tests, the same thing happening all the time.

i'm using 1.0.9, i then loaded the sketch with 1.0.5 and everything works ok. something is very wrong here.
Re: P3D camera vs OPENGL camera
Reply #6 - Dec 1st, 2009, 1:49pm
 
yes, am seeing the same thing here.

i changed the draw() inside the nested loop so that the triangles were wireframe and different colours:

colorMode(HSB, 50);
stroke(color(x, 40, 40));
noFill();

and you can see when you go above 100 that the lines just zoom off to the distance.

i've seen or read something about this before but can't find anything.

it works in opengl though 8)
Re: P3D camera vs OPENGL camera
Reply #7 - Dec 1st, 2009, 2:51pm
 
a send a PM to processing, meanwhile i'm back to 1.0.5.
i'll keep an eye on 1.0.9 maybe they change that.

koogy, thanks a lot for your help.
Re: P3D camera vs OPENGL camera
Reply #8 - Dec 24th, 2009, 8:28am
 
Thought you might like to know I was experiencing a similar problem when creating a 'camera' that would travel over a 3D terrain, I was using P3D and was getting all sort of weird distortion of the terrain. I never thought of trying OPENGL until I searched the forum and came across this thread. I tried it with OpenGL and bingo it worked beautifully so thanks for that.

I am creating the program in Eclipse using Processing 1.0.9 libraries, so switching the core.jar file to the 1.0.5 version with the same result as you in that P3D worked. It appears P3D got broken between 1.0.5 and 1.0.9  Cry

Page Index Toggle Pages: 1