Rotation/orientaton problem

Blitz3D Forums/Blitz3D Programming/Rotation/orientaton problem

Ok I want to make a turret on a tank that swivels and looks exactly at what it’s firing at, this is a simple matter while the tanks orientation remains flat and unchanged, however the tank moves over uneven terrain and it’s orientation changes. How can I still get the tank turret to properly point at it’s target, baring in mind I want to be able to turn the turret and move the gun up and down using the turnentity command.

Suggestions would be greatly appreciated!

pointentity turret, target

or did i miss something?

Use, something like:
PointEntity turret,target
RotateEntity turret,0,EntityYaw(turret),0


I hope you have 3 entities: The tank, the turret house, and the turret. And then you need some math, hmmm... The problem is to make the turret house rotate correctly, right?

The turret should be in 2 parts, the turret itself and the gun. pointentity the gun towards the target and then turn the turret based on the gun.

Andy