ok I am making a space simulator and I want to have a cockpit inside my spaceship. I have a couple of questions:
One, the mousemove feature seems to move by pixel and it is very jerky, how would I make it smooth?
Two, I have a ship that is rotating in all three axises and I want the camera to be inside the cockpit but I cant get the rotating right.
Three, what is the minimum range for the camera and can it be set to zero? (its not rendering close things to the camera inside the cockpit.)
------FIXED----------
use: SET CAMERA RANGE near value, far value
some of my code:
do
`Output the framerate
text 0, 0, "Screen FPS: "+str$(screen fps())
rem object 5 is my main ship
EZro_Set OBJECT ANGLE X(5),OBJECT ANGLE Y(5),OBJECT ANGLE Z(5)
if upkey() = 1 then EZro_LX -1
if downkey() = 1 then EZro_LX 1
if leftkey() = 1 then EZro_Lz -1
if rightkey() = 1 then EZro_Lz 1
if keystate(30) = 1 then EZro_Ly 1
if keystate(32) = 1 then EZro_Ly -1
rem these are declared to be foats at the beginning
rem so I dont need a # sign
xangle1 = EZro_GetX()
yangle1 = EZro_GetY()
zangle1 = EZro_GetZ()
msx = object position x(5)
msy = object position y(5)
msz = object position z(5)
position object 8,limb position x (5,nl+5),limb position y (5,nl+5),limb position z (5,nl+5)
xthrust# = 0
ythrust# = 0
zthrust# = 0
if keystate(17) = 1
xthrust# = limb position x (5,nl+5) - msx
ythrust# = limb position y (5,nl+5) - msy
zthrust# = limb position z (5,nl+5) - msz
endif
if keystate(31) = 1
xthrust# = -(limb position x (5,nl+5) - msx)
ythrust# = -(limb position y (5,nl+5) - msy)
zthrust# = -(limb position z (5,nl+5) - msz)
endif
xspeed = (xspeed + xthrust#) *.997
yspeed = (yspeed + ythrust#) *.997
zspeed = (zspeed + zthrust#) *.997
set cursor 10,50
print xspeed
print yspeed
print zspeed
position object 5,msx+xspeed,msy+yspeed,msz+zspeed
rem ---------------- MY TROUBLES START-------
`this limb is in the position of the cockpit so I can have the
`camera there....
EZro_Set limb angle x (5,nl+6),limb angle y (5,nl+6),limb angle z (5,nl+6)
EZro_LX mousemovey()
EZro_Lz mousemovez()
rotate limb 5,nl+6,EZro_getx(),EZro_gety(),EZro_getz()
position camera 0,limb position x (5,nl+6),limb position y (5,nl+6),limb position z (5,nl+6)
rotate camera 0,limb angle x (5,nl+6),limb angle y (5,nl+6),limb angle z (5,nl+6)
ROTATE OBJECT 5,xangle1,yangle1,zangle1
rotate limb 5,nl+2,xangle2,zangle2,110
rotate limb 5,nl+3,xangle2,zangle2,-110
Sync
loop
I would really apreciate some help here. I have tryed rotating the limb but it didnt work. I just dont know what else to try.
Wild_Doogy