freelancer like controls...
Blitz3D Forums/Blitz3D Beginners Area/freelancer like controls...
| ||
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 |
| ||
I would guess a combination of things including pointentity, createpivot, etc. |
| ||
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... |
| ||
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 |