rifter1818
Junior Contributor
Ok, im pretty much a begginer at using matrix.whatever math,a begginer in 3d graphics in general but none the less i got my program semiworking.
I have two functions using matrix math, Translate (vector3) and rotatey(angle)
now if i say translate(vector3) and then draw the mesh it draws the mesh where i want it to, or if i say rotatey(angle) then draw the mesh it draws it at the correct angle, the problem is i want to to BOTH for the same mesh but it only does the latter, if i call Translate(vector) then Rotate(angle) then draw it only rotates or if i call Rotate then translate then draw it only translates! help me please what do i do to do both?
I have two functions using matrix math, Translate (vector3) and rotatey(angle)
now if i say translate(vector3) and then draw the mesh it draws the mesh where i want it to, or if i say rotatey(angle) then draw the mesh it draws it at the correct angle, the problem is i want to to BOTH for the same mesh but it only does the latter, if i call Translate(vector) then Rotate(angle) then draw it only rotates or if i call Rotate then translate then draw it only translates! help me please what do i do to do both?
Visual Basic:
Public Sub RotateY(ByRef angle As Single)
D3DDevice.Transform.World = Matrix.RotationY(angle)
End Sub
Public Sub Translate(ByRef vector As Vector3)
D3DDevice.Transform.World = Matrix.Translation(vector)
End Sub
'seperate module
For icount = 0 To numMonsters - 1
DX9.RotateY(Monsters(icount).Angle)
DX9.Translate(New Vector3(Monsters(icount).x * 151, 0, Monsters(icount).y * 151))
Monsters(icount).mMesh.DrawMesh(DX9.D3DDevice)
Next
For icount = 0 To numCharactors - 1
DX9.RotateY(Charactors(icount).Angle)
DX9.Translate(New Vector3(Charactors(icount).X * 151, 0, Charactors(icount).Y * 151))
Charactors(icount).cMesh.DrawMesh(DX9.D3DDevice)
Next