Mode 7 style effects in Max2D
BlitzMax Forums/BlitzMax Programming/Mode 7 style effects in Max2D
| ||
Is there any way to achieve effects like - tilting a sprite into the z-axis - zooming and tilting the camera by (ab)using the Max2D library? |
| ||
Max2D uses an orthographic parallel projection, it has no perspective, so although you can apply rotation in all 3 axis, and it will sort of look like it rotates, the degree of rotation will be way inproportional. With a command like glRotatef(), it wont move in perspective, without first calling something like gluPerspective() or glFrustum() (in openGL) or some DX calls. You also shouldn't really change the projection matrix to zoom or tilt the camera, you should move the modelview in front of the camera. |
| ||
Max2D uses an orthographic parallel projection, it has no perspective, so although you can apply rotation in all 3 axis, and it will sort of look like it rotates, the degree of rotation will be way inproportional. With a command like glRotatef(), it wont move in perspective, without first calling something like gluPerspective() or glFrustum() (in openGL) or some DX calls. You also shouldn't really change the projection matrix to zoom or tilt the camera, you should move the modelview in front of the camera. |
| ||
You can do the latter by manipulating the projection matrix, for which there is a module around. One of IndiePaths, I believe. |
| ||
I have done an isometric view heightfield terrain with zoom, tilt, and 360 degree rotation using the textured poly routines found on the forums here (Indiepath's and others). So yes, you can do quite a lot. |
| ||
seems the obvious way would be to use a textured quad in opengl mode. |
| ||
I'm interested in this too... |
| ||
You also shouldn't really change the projection matrix to zoom or tilt the camera, you should move the modelview in front of the camera. Not if you have a more than a couple of models.Read up on projection matrices and you will find out how to make isometric and perspective projections. |
| ||
Read up on projection matrices and you will find out how to make isometric and perspective projections. Got any links? :) (In any case, the answer to 'can you do this with Max2D' seems to be: not without some pretty major hacking around. Too bad.) |
| ||
Perspective Projection and the View Frustum which is taken from the DX SDK documentation. Check modules D3D7Max2d.bmx and GLmax2d for how Bmax sets these and get a copy of projmatrix.bmx to see how Tim uses it. |