Can I change the camera to an isometric perspective?
by John Klimek · in Torque Game Engine · 01/21/2009 (3:38 pm) · 3 replies
Can I easily change the camera in TGE to an isometric perspective? (eg. like Neverwinter Nights, etc)
If so, how?
Thanks for any help!
If so, how?
Thanks for any help!
About the author
Associate Orion Elenzil
Real Life Plus
i was able to hack it together by defining a global variable gOrthoScale,
and then changing dglSetFrustum to this:
F32 gOrthoScale = 1.0f; void dglSetFrustum(F64 left, F64 right, F64 bottom, F64 top, F64 nearPlane, F64 farPlane, bool ortho) { // this converts from a coord system looking down the pos-y axis // to ogl's down neg z axis. // it's stored in OGL matrix form static F32 darkToOGLCoord[16] = { 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1 }; frustLeft = left * gOrthoScale; frustRight = right * gOrthoScale; frustBottom = bottom * gOrthoScale; frustTop = top * gOrthoScale; frustNear = nearPlane; frustFar = farPlane; isOrtho = dglIsOrtho(); if (ortho) { glOrtho(left, right, bottom, top, nearPlane, farPlane); worldToScreenScale = viewPort.extent.x / (frustRight - frustLeft); } else { glFrustum(left, right, bottom, top, nearPlane, farPlane); worldToScreenScale = (frustNear * viewPort.extent.x) / (frustRight - frustLeft); } glMultMatrixf(darkToOGLCoord); }and exposing the variable to script,but it's very, very hacky and definitely not ready as a user-facing feature.