freelancer like controls...

Blitz3D Forums/Blitz3D Beginners Area/freelancer like controls...

scurvy(Posted 2004) [#1]
hi,

i want to make freelancer like controls for my game. i especially want to have the ship canons track the mouse pointer. how do i go about this?

thx


Perturbatio(Posted 2004) [#2]
I would guess a combination of things including pointentity, createpivot, etc.


scurvy(Posted 2004) [#3]
yeah, but the problem is the mouse pointer is 2d and the ship canons are in 3d.

how to make a 3d object track a 2d one?

in my opinion i'd have to virutally place the mouse pointer in the 3d world, but if i do so i'm loosing accuracy for the targeting...


RiverRatt(Posted 2004) [#4]
I have just made a HUD screan that does kind of the same thing using entityinview and camera proect comands.
it works only on acual entities though not with copied entities. This code is just taken out of a game i am working on, kinda. it draws a line from the mouse pointer
to the entity listed ie ufo and a triangle around the entity.


CameraProject(camera,EntityX(Model),EntityY(Model),EntityZ(Model))

If EntityInView (Model,camera) = True Then

Text ProjectedX#()+10,ProjectedY#()+20,"UFOMESH"
Text 240,460,"entity in view"

Color 100,0,25
Line ProjectedX#(),ProjectedY#(),320,240
;triangle lock
Color 25,255,25
Line ProjectedX#()+10,ProjectedY#()+10,ProjectedX#(),ProjectedY#()-10
Color 25,255,25
Line ProjectedX#()-10,ProjectedY#()+10,ProjectedX#(),ProjectedY#()-10
Color 25,255,25
Line ProjectedX#()+10,ProjectedY#()+10,ProjectedX#()-10,ProjectedY#()+10