Skip to main content
GameDev.net gamedev.net
🔒 Locked

Perspective Scale with 2D

Started by GenuineXP Apr 12, 2007 at 10:26 PM 0 replies 500+ views
Original Post
GenuineXP
GenuineXP
I've setup an orthographic view in OpenGL to do 2D rendering. I use glOrtho() to setup the projection matrix, so there's no perspective correction. However, I'd like to be able to move textured shapes (quads, etc.) along the z-axis and have them get smaller/larger. Can this be done? I'm pretty sure it's not possible using glOrtho(), but could gluPerspective() give me the effect I want? I want to be able to use scaling nodes in my scene graphs, but scaling a matrix and passing it to OpenGL doesn't have any effect with my projection matrix. Thanks!
jouley
jouley
Unless I'm misunderstanding your question, the z-depth of a quad has no effect on its size when using an orthographic projection, so you'll have to scale it yourself. A perspective projection, though, should automatically cause far things to be smaller, near things to be bigger.

A "scaling node," I assume, would just be the root of a tree that has a call to glScale*, no? If so, what doesn't work about it?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.