I'm trying to add a force that will push a sphere forward (On X and Z axis's) from the camera view. So no matter what y angle the camera is, the sphere will roll directly away from camera.
A rough example:
`Main loop
do
time# = NDB_GetElapsedTimeInSec()
NDB_NewtonUpdate time#
Angle = Angle + MouseMove x()
set camera to follow object position x (Ball), object position y (Ball), object position z (Ball), Angle, Distance, Height, Smooth
if mouseclick() = 1
NDB_SetVector 1, 0.0, 0.0, 0.0
`Here's the problem. I don't know how to calculate the X and Z
NDB_SetVector 2, Angle +-/* ???, 0.0, Angle /*-+???
NDB_BodySetForceGlobal Ball
endif
sync
loop
I'm no good at math, so any help will be greatly appreciated! If I'm not clear, I'll try better to explain myself.