I have read the forums and tried many times to rotate my cube but with no success.
Can you please show me how to implement this into my existing code so I can finally learn the concept of 3D rotation. I would greatly appreciate it!
REM Project: test
REM Created: 7/1/2008 10:46:00 PM
REM
REM ***** Main Source File *****
REM
autocam off
sync on
sync rate 60
cam = 0
cx = 50
cy = 20
cz = 0
cube = 1
x = 0
y = 5
z = 0
cube2 = 3
x2=0
y2=5
z2=-30
plain = 2
MAKE OBJECT PLAIN plain, 100, 100
ROTATE OBJECT plain, 90, 0, 0
make object cube cube,10
POSITION OBJECT cube, x, y, z
make object cube cube2,10
POSITION OBJECT cube2, x2, y2, z2
`load image "cube_bmp.bmp",1
`load image "floor_texture.bmp",2
`texture object 1,1
`texture object 3,1
`texture object 2,2
position camera cam,cx,cy,cz
point camera 0,0,0
do
if x < 45
if downkey()=1
x=x+1
cx = x + 50
position object cube,x,y,z
position camera cam,cx,cy,cz
endif
endif
if x > -45
if upkey()=1
x=x-1
cx = x + 50
position object cube,x,y,z
position camera cam,cx,cy,cz
endif
endif
if z > -45
if leftkey()=1
z=z-1
cz = z + 0
position object cube,x,y,z
position camera cam,cx,cy,cz
endif
endif
if z < 45
if rightkey()=1
z=z+1
cz = z + 0
position object cube,x,y,z
position camera cam,cx,cy,cz
endif
endif
sync
set cursor 0,0
print "cube x: ", x
print "cube y: ", y
print "cube z: ", z
print "cam x: ", cx
print "cam y: ", cy
print "cam z: ", cz
print "mousex: ",mousex()
print "mousey: ",mousey()
print "mousez: ",mousez()
loop