Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-12 Thread Theo Ribeiro
Hi everyone, it's me again. I've managed to get everything right a few days ago, I was just missing a viewer.realize() command! Now I can check that all of my matrices are ok, the values are what they were supposed to be. However, the world coordinates I'm getting after all the math are a bit

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-08 Thread Jean-Sébastien Guay
Hi Theo, I just have a small little question: when you multiply your screen coordinates by the inverse matrix you are using the z values of 0.0 and 1.0 for the points on the near and far planes, right? Are you using these values because they were previously set on your projection matrix or

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-08 Thread Jean-Sébastien Guay
Hi Theo, Sorry to bother you so much with this J-S but I just can't figure out what am I doing wrong! I'm sure it's something really simple! I think you'll have to read about the math involved, look at the values in the debugger and work out what you're supposed to get on paper... I wanted

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-08 Thread Theo Ribeiro
Skylark wrote: Hi Theo, I think you'll have to read about the math involved, look at the values in the debugger and work out what you're supposed to get on paper... I wanted to put you on the right track to be able to understand what's going on, not give you a recipe that you blindly

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-07 Thread Martin Scheffler
theoribeiro: Just set your ortho projection values to your screen size: (0, 1024, 0, 768) or whatever. Also set your camera viewport: camera-setViewport(0, 0, 1024, 768). Now the OSG units correspond to pixels on your screen. -- Read this topic online here:

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-07 Thread Jean-Sébastien Guay
Hi Theo, I'll have a camera that will be still for the whole time. 2D objects will be put in front of the camera as it was a 2D application. Although, sometimes these 2D objects will spin around an axis in 3D. So, I cannot use the Ortho projection. Why not? Your objects are still in 3D

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-07 Thread Theo Ribeiro
Hi Jean-Sebastien and Martin, Thank you both for helping. J-S, that's exactly it. I still want to have perspective within my objects. As for the coordinates, I can see where you are going but I still don't know how can I know the boundaries of my camera view on the xz plane. I mean, if I use

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-07 Thread Jean-Sébastien Guay
Hi Theo, As for the coordinates, I can see where you are going but I still don't know how can I know the boundaries of my camera view on the xz plane. I mean, if I use the ortho projection I can set it and my viewport to the size of my screen and I'll know exactly what coordinates the

Re: [osg-users] 3D Scene emulating a 2D environment

2010-07-07 Thread Theo Ribeiro
Hi J-S, Now I see what you mean by world coordinates and your calculations! Stupid newbie me! =) I usually have a hard time relating OSG and OpenGL (which I'm no expert btw), but in the end the concepts are all the same!!! I just have a small little question: when you multiply your screen

[osg-users] 3D Scene emulating a 2D environment

2010-07-06 Thread Theo Ribeiro
Hi, I have to render a scene that pretends to be a 2D environment. But I need it to be 3D so that I can work with the Z component. I'll try to explain it better. I'll have a camera that will be still for the whole time. 2D objects will be put in front of the camera as it was a 2D application.