Hey, I'm just trying to get a cube to move around like an airplane or spaceship, just for something to do. I read in another thread that:
Quote: "your camera wont follow right if u use turn object right/left .
u should use yrotate object instead.
i had this problem when i 1st started using dbp."
by David iz cool.
I am getting three problems.
A. The cube won't pitch up/down while it's turning left/right.
B. I am trying to get the turn speed / pitch speed to increase if you hold the corresponding button longer. This isn't working.
C. The YROTATE OBJECT is working fine, but I am still having the above problem. Pitch doesn't work though. It just pitches at insane angles wildy, and I don't understand it.
Rem Project: space
Rem Created: 07/03/2007 01:28:07
Rem ***** Main Source File *****
MAKE OBJECT CUBE 1,100
position object 1,0,0,0
scale object 1,10,10,10
make matrix 1,1000,1000,10,10
position matrix 1,0,0,0
camx=object position x(1)
camy=object position y(1)
camz=object position z(1)
rotx=object angle x(1)
roty#=object angle y(1)
rotz#=object angle z(1)
speed#=0.1
do
if upkey()=1 then pitch object down 1,rotz# : dec rotz#,0.1
if downkey()=1 then pitch object up 1,rotz# : inc rotz#,0.1
if rightkey()=1 then yrotate object 1,roty# : inc roty#,0.1
if leftkey()=1 then yrotate object 1,roty# : dec roty#,0.1
if spacekey()=1
if spacekey()=0 and speed#>0 then move object 1,speed#+0.02
move object 1,speed#
inc speed#,0.001
endif
if speed#>2 then speed#=2
if speed <-2 then speed#=-2
if controlkey()=1
move object 1,speed#
dec speed#,0.1
endif
Position Camera Object Position X(1),Object Position Y(1)+35,Object Position Z(1)
Rotate Camera Object Angle X(1),Object Angle Y(1), Object Angle Z(1)
Move Camera -(100)
loop
I am getting some of this code from the "HELP ME (space game)" thread.
Thank you if you can help, I know I'm new to DarkBasic, but we all have to start somewhere.