3d Crosshair help!

Blitz3D Forums/Blitz3D Programming/3d Crosshair help!

Mortiis(Posted 2007) [#1]
I'm working on a topdown view arcade game.It's an 360 space shoot'em up.The problem is, I want to have a 3d crosshair(a
quad) in it.I want it to move with my spaceship as it's child but I don't want it to rotate with the ship.Cause it messes up the mouse control of the crosshair.I tried to parent the spaceship's pivot to the crosshair's but it rotates the cross with it too.Long story short;

-Spaceship is keyboard controlled
-Crosshair is mouse controlled
-I want crosshair to move with my ship BUT not rotate with it

Any help will be greatly appreciated! :) Thanks in advance.


b32(Posted 2007) [#2]
Maybe you could use TFormPoint?
TFormPoint 0, 0, 5, ship, 0
PositionEntity crosshair, TFormedX(), TFormedY(), TFormedZ(), 1



Mortiis(Posted 2007) [#3]
Problem solved.Parented the camera to the crosshair in the mainloop solved it.Thanks anyway.


jfk EO-11110(Posted 2007) [#4]
Normally you would parent the crosshair to the camera, not the other way round. You may however parent the crosshair to the ship so it will move with it, and then correct the rotation each frame using the rotation angles of the camera, eg:
rotateentity cross,entitypitch(cam),entityyaw(cam),entityroll(cam),1

Tho, since the problem is solved, it doesn't matter that much.