Hello,
I have a rather simple question and I apologize if it has been asked before. I use a camera with an orthogonal projection for a 2D game and I want to give the user the illusion of depth using the scene nodes' Z position.
I will give an example: With an orthogonal projection, the scene nodes appear the same regardless of their Z value. If I move the camera left by 100px, all the scene nodes appear to move right by 100px, like they were all at the same distance from the camera. But, what I want to do is make the scene nodes appear to be farther away from the camera based on their Z value. If the camera moves 100px to the left, I want a scene node with a Z value of 200px to move only 50px to the right (or similar values).
I hope I have made myself clear. So, is there any simple way to achieve this? The only solution I can think of is manually moving scene nodes when moving the camera, which is a little tedious.
Thank you in advance!
Orthogonal camera with illusion of depth
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Wouldn't scaling the objects change their size? I want the objects to maintain their size regardless of their distance from the camera, just like in an orthogonal projection. I only want them to move slower when moving the camera to give the illusion of depth. Think of a space shooter with multiple layers of stars in the background; when you scroll, some stars move slower and give the impression that they are farther away.