Menu/Rotation problem
Hi, I have two questions:
1. how should I go about making a menu for my game?
2. My game uses two triangles forming a rectangle with a texture of a ship on it. The camra points down at all times so it looks 2D. the problem is that when I rotate it it stretches then shrinks slightly every half turn (using D3D). how do I fix that?
Thanks!
www.InfiniteAbyss.net
Any chance of you posting your rotation code ?? Or are you simply rotating the camera/world matrix ??
(VB Code is fine)
Adam "Nutz" Hoult
VB Gaming Central
(VB Code is fine)
Adam "Nutz" Hoult
VB Gaming Central
use a .x file for the ship.
or...
are you using helper functions to do rotation or doing it manually?
use framework functions (defined in d3dutil.h and d3dmath.h):
there are d3dx equivelents to this, but i dont know them
Edited by - POINT on July 31, 2000 7:02:06 PM
Edited by - POINT on July 31, 2000 7:03:01 PM
or...
are you using helper functions to do rotation or doing it manually?
use framework functions (defined in d3dutil.h and d3dmath.h):
D3DMATRIX matTranslate;D3DMATRIX matRotate;D3DMATRIX finalMatrix;D3DUtil_SetTranslateMatrix(matTranslate, x, y, z);D3DUtil_SetRotateYMatrix(matRotate, angle); //replace the Y with or zD3DMath_MatrixMultiply(finalMatrix, matRotate, matTranslate);d3dDevice.SetTransform(D3DTRANSFORMSTATE_WORLD, &finalMatrix);//render tris now
there are d3dx equivelents to this, but i dont know them
Edited by - POINT on July 31, 2000 7:02:06 PM
Edited by - POINT on July 31, 2000 7:03:01 PM
Make sure you define the aspect ratio correctly in the projection matrix. If you use D3DUtil_SetProjectionMatrix, use an aspect ratio of 0.75 (I think it would also work if you use the D3DX functions to generate a projection matrix).
Edited by - jg1 on July 31, 2000 8:36:30 PM
Edited by - jg1 on July 31, 2000 8:36:30 PM
I''m rotating the world matrix using:
dx.RotateYMatrix matrix, rot
device.SetTransform D3DTRANSFORMSTATE_WORLD, matrix
www.InfiniteAbyss.net
dx.RotateYMatrix matrix, rot
device.SetTransform D3DTRANSFORMSTATE_WORLD, matrix
www.InfiniteAbyss.net
That should be fine, sounds like your projection matrix is slightly screwy, giving a "FishBowl" effect maybe ??
Try setting your projection matrix like this
dx.IdentityMatrix matProj
dx.ProjectionMatrix matProj, 1.01, 1000, g_PI / 3
d3dDevice.SetTransform D3DTRANSFORMSTATE_PROJECTION, matProj
I always find I have better (or more realistic looking results) when using g_PI /3 instead of the standard Pi / 2
I may be off line here, but worth a try no ??
HTH
Adam "Nutz" Hoult
VB Gaming Central
Try setting your projection matrix like this
dx.IdentityMatrix matProj
dx.ProjectionMatrix matProj, 1.01, 1000, g_PI / 3
d3dDevice.SetTransform D3DTRANSFORMSTATE_PROJECTION, matProj
I always find I have better (or more realistic looking results) when using g_PI /3 instead of the standard Pi / 2
I may be off line here, but worth a try no ??
HTH
Adam "Nutz" Hoult
VB Gaming Central
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement