ThePentiumGuy
Well-known member
Matrix Translations in D3D
hey, im a little hazy about the subject of matrix transformations,
im trying to develop a (3d) racing game.
i have a mesh class which has an instance of a camera class, so my car and my platform mesh bothj have their own "cameras" (or you could say their own vector3s for Position, Target, and .. well the Up vector is the same for all of them - i have instances for each mesh so i can use them for world translatiion purposes)
ok,
my (skimmed down) render loop looks like this(in pseudocode as i dont really have a computer and im trying to figure this out)
BeginScene
Platform.SetupWorld
Platform.Render
Car.SetupWorld
Car.Render
EndScene
Present (i dont remmeber whether its present before Endscene or endsene before present lol but that doesnt matter )
my setup world sets up a LookAtLH view matrix and a perspectiveFOVLH projection matrix for each of htem
my dillema is this:
in order to get the effect that the car is moving (for example) forwards, i have to make the platform move backwards...
thats all said and done becuase whjen i push up i move the platforms camera down..etc
however, i want to be able to get the cars actual position and be able to do a mesh.intersect with it, for that ill need the cars "real" position,
i tried doing this
platform.setupworld becusae the platform moves
platform.render
car.render dotn move the car just rendfer it
and when i push(for example) space, the platform moves down, and the car moves up
but it gets confusing when i have to do Mesh.Intersect becuase the car is really 2x further into the platform then it thinks it is..
---
im sorta confusing myself here as i write this
my real plea is - can someone clarify matrix Transformations for me please
and tell me the best way to render my objects
pent
hey, im a little hazy about the subject of matrix transformations,
im trying to develop a (3d) racing game.
i have a mesh class which has an instance of a camera class, so my car and my platform mesh bothj have their own "cameras" (or you could say their own vector3s for Position, Target, and .. well the Up vector is the same for all of them - i have instances for each mesh so i can use them for world translatiion purposes)
ok,
my (skimmed down) render loop looks like this(in pseudocode as i dont really have a computer and im trying to figure this out)
BeginScene
Platform.SetupWorld
Platform.Render
Car.SetupWorld
Car.Render
EndScene
Present (i dont remmeber whether its present before Endscene or endsene before present lol but that doesnt matter )
my setup world sets up a LookAtLH view matrix and a perspectiveFOVLH projection matrix for each of htem
my dillema is this:
in order to get the effect that the car is moving (for example) forwards, i have to make the platform move backwards...
thats all said and done becuase whjen i push up i move the platforms camera down..etc
however, i want to be able to get the cars actual position and be able to do a mesh.intersect with it, for that ill need the cars "real" position,
i tried doing this
platform.setupworld becusae the platform moves
platform.render
car.render dotn move the car just rendfer it
and when i push(for example) space, the platform moves down, and the car moves up
but it gets confusing when i have to do Mesh.Intersect becuase the car is really 2x further into the platform then it thinks it is..
---
im sorta confusing myself here as i write this
my real plea is - can someone clarify matrix Transformations for me please
and tell me the best way to render my objects
pent
Last edited by a moderator: