how do i place an object in fromt of my camera.
Archives Forums/Blitz3D SDK Programming/how do i place an object in fromt of my camera.
| ||
I need to be able to place an entity in front of my camera, regardless of where it is looking (pitch and yaw only), so how can i convert the camers pitch and yaw values into x and y values , i have tryed all sorts and i cant seem to find a simple formula to do this. i wish i had paid more attention to triganometorey at skhool... |
| ||
back again, i also need to send the entity of alond the z axis the camera is pointing (away from the camera) in a straigt line (like a bullet from a gun) |
| ||
See http://blitzbasic.com/b3ddocs/command.php?name=TFormPoint&ref=goto for the Blitz3D TFormPoint command. For example TFormPoint 0,0,5, YourCamera, 0 would transform the point (0,0,5) from YourCamera's space into world space. i.e. the point 5 units in front of YourCamera is transformed to world co-ordinates. TFormedX() etc. retrieves the results. You could start by experimenting with the example given in the Blitz3D example from the online manual. Turn it into SDK code with bbTFormPoint and so on. |
| ||
thanks for the help, i will go and play with the examples, |