not sure what your asking but il have a go
SetObjectRotation(id,angX,angY,AngZ) will set a object to any angle
then moveObjectZ(id,1) will move in the direction you have rotated towards
if you want to fire a bullet at a given angle in 3D space there is vector mathematics required
fortunately AppGameKit has some methods that make this easier by simply setting your bullet at the
desired angle and using the move command to determine the next position vector the method
below uses this
// the type used for bullets
type bullet
ID as integer
time as float // a time used because bullets die over time
endtype
global myBullet as bullet[0] //we start with no bullets but use an array that we can insert more
//There is no limit to bullets but a timer of bulletlife for how long they live
for num=1 to bulletCount
if (myBullet[num].time)+bulletLife<timer()
DeleteObject(myBullet[num].ID)
myBullet.remove(num)
dec bulletCount
endif
next num
function ThrowBall( initialSpeed as float, mass as float)
//To move dynamic physics bodies we need to apply velocity to the physics body.
gunPositionVec= CreateVector3(GetObjectWorldX(playerObj),GetObjectWorldY(playerObj)+camOff_y#,GetObjectWorldZ(playerObj)) //im using the camera position as the gun position
//Create a tempory projectile block to calculate movement vectors of bullets
projectileDirBox as integer
projectileDirBox = CreateObjectBox( 1.0, 1.0, 1.0 )
SetObjectPosition( projectileDirBox, GetVector3X( gunPositionVec ), GetVector3Y( gunPositionVec ), GetVector3Z( gunPositionVec ) )
setobjectrotation(projectiledirbox,camangle_x#,GetObjectWorldAngleY(playerObj),GetObjectWorldAngleZ(playerObj))
MoveObjectLocalZ( projectileDirBox, 1.0 )
projectileDirVec = CreateVector3( GetobjectWorldX( projectileDirBox )-GetVector3X( gunPositionVec ), GetobjectWorldY( projectileDirBox )-GetVector3Y( gunPositionVec ), GetobjectWorldZ( projectileDirBox )-GetVector3Z( gunPositionVec ) )
DeleteObject( projectileDirBox )
throwBall as integer
throwBall = CreateObjectSphere( 10, 16, 32 )
SetObjectColor( throwBall, 255, 0,0,255 )
SetObjectPosition( throwBall, GetVector3X( gunPositionVec ), GetVector3Y( gunPositionVec ), GetVector3Z( gunPositionVec ) )
//3D Physics code
Create3DPhysicsDynamicBody( throwBall )
SetObjectShapeSphere( throwBall )
SetObject3DPhysicsMass( throwBall, mass )
SetObject3DPhysicsLinearVelocity( throwBall, projectileDirVec, initialSpeed )
myItem as bullet
myItem.ID = throwBall //the object id of the bullet
myItem.time = timer() //timer is used to set there life time as bullets will die off after so long
myBullet.insert(myItem) //update bullet arrow as there is unlimeted bullets
inc bulletCount //used for a bullet counter to check if theyve timed out or not
deletevector3(projectileDirVec)
deletevector3(gunPositionVec)
endfunction
PS This is how its done in AppGameKit there is no mention on what language you would like to do this ine
fubar