Jump to content
  • Advertisement
Sign in to follow this  
Coriiander77

Perspective (in)correct rendering of 3D models in a semi 2D world

This topic is 2788 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well, using orthographic projections would give you the first result, but then your stuff wouldn't scale with depth (I guess you could fake that by explicitly scaling objects that are farther away). If you insist on a perspective projection you could get the desired effect by always orienting the objects "towards" the camera like you would do when using billboarding. But what is the point of having 3D models if you take away all the 3D aspects? If you only want to see one side of the model then render that side to a texture and only render a quad.

Edit: I didn't realize that you might want to explicitly rotate stuff. I guess in this case the "faking it" approach by applying a scaling factor depending on z would be a reasonable starting point.

Share this post


Link to post
Share on other sites

Well, using orthographic projections would give you the first result, but then your stuff wouldn't scale with depth (I guess you could fake that by explicitly scaling objects that are farther away). If you insist on a perspective projection you could get the desired effect by always orienting the objects "towards" the camera like you would do when using billboarding. But what is the point of having 3D models if you take away all the 3D aspects? If you only want to see one side of the model then render that side to a texture and only render a quad.

Edit: I didn't realize that you might want to explicitly rotate stuff. I guess in this case the "faking it" approach by applying a scaling factor depending on z would be a reasonable starting point.


Thank you for your reply. Orthographic projection is no option. In these example pictures you see a simple cube, but in reality you'd see a spacecraft. A 3d model that has depth. I want to see this depth, and I want to be able to roll it over. Also, it just simply has to be 3D as there will be like cutscenes. For example a boss-ship coming flying in. This boss ship would be truly 3D when it comes flying in. It comes from the depth, might rotate like whatever 3D model in any 3D game. But once it is in position, it should sort of switch to semi-3D mode.


It's just like the 3D model should look like when it is exactly centered around 0, 0, 0 - middle of screen. there it can rotate, scale, receive lightning as desired. But once it moves, all stuff gets distorted (perspective correction). This 'distortion' / correction is not desireable, yet the model really has to stay 3D, because at times it does come desireable to have a full 3D mode.

I understand what you try to say. This was what I ment with rendering to some texture like as if the model was in the middle of the screen. Then I'd render this texture on a quad on the desired position. I would have full rotation possibilities, (and possibly, OFF-TOPIC HERE!, optional pixelperfect collission testing-ability), without the side effect of seeing undesired sides of the 3D model. But I fear this might become a bottleneck speedwise. Isn't it a bad approach to render every 3D model to a texture, and then move that texture into the back buffer manually? Yes, it does work. But I am very afraid it will get me into problems. Speedwise, but also with regards to lightning effects (scene-wise).

Share this post


Link to post
Share on other sites
Orthographic projections don't take away the 3D-ness of the models and won't keep you from rotating them however you wish. There is just no "perspective correction" as you call it. As long as objects don't have huge depth they shouldn't look that different anyway. What you want "breaks the laws of geometry" which also means you have to compromise at some point. I described two ways to do that. Using locally orthographic projections or orienting everything towards the camera. The "billboarding" approach for example would produce unnatural looking results for very deep objects like some sort of spire rising towards the player...

I personally would just stick with a perspective projection and use a rather narrow field of view.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!