Moving an entity based on camera angle.
Blitz3D Forums/Blitz3D Programming/Moving an entity based on camera angle.
| ||
Anyone ever writen something that enabled you to move an entity using the mouse, based on the position and angle that the camera was looking at it? For example, a little editor im working on at the moment has movement of the selected entity simply going along X,Y,Z... very simple stuff that works ok when the camera is in the default position, but move the camera to the side or behind and its difficult to use. Ive tried for ages to work this out but my maths leaves a lot to be desired, would really appreciate some idea's if you can. Thanks in advance |
| ||
You could do something like this:TFormVector MouseXSpeed(),-MouseYSpeed(),0,camera,0 TranslateEntity entity,TFormedX(),TFormedY(),TFormedZ() |