using dbpro. i locked the camera to the y rotation axis of the model. and the models rotation is controlled muy mouse. however if i independently try to rotate the camera it does not work correclty-
xrotate camera camera angle x()+mousemovey()/3
please check my source.
SET DISPLAY MODE 1280,1024,32
hide mouse
color backdrop 0,1
set ambient light 100
LOAD OBJECT "EXPORT.x",3
load object "bathroom.x",1
load object "bathroom_lm.x",2
ghost object on 2,1
LOAD OBJECT "gun.x",5
glue object to limb 5,3,60
scale object 5,.3,.3,.3
roll object right 5,90
yrotate object 5,90
position object 1,0,-70,0
scale object 1,30,30,30
set object speed 3,70
scale object 3,6000,6000,6000
YROTATE OBJECT 3,180 : FIX OBJECT PIVOT 3
position object 3,0,0,0
Do
obplay#= object playing(3)
if upkey()=0
if obplay# =1
stop object 3
endif
endif
if obplay# =1
gosub obplay:
endif
if upkey()=1
play object 3,72,96
endif
obplay:
load image "health.bmp",2
sprite 2,1180,980,2
set sprite alpha 2,100
load image "crosshair.bmp" ,1
sprite 1,625,498,1
`camera control
`anglex# = camera angle x()
`angley# = camera angle y()
` anglex# = wrapvalue(angx# + (mousemovey()/2))
`angleley# = wrapvalue(angley# + (mousemovex()/2))
`update camera
`rotate camera 0,anglex#,angley#,0
`Control input for camera
If Upkey()=1
Move object 3,12
Endif
if downkey()=1
move object 3,-12
endif
r#=screen fps()
text 0,40,str$(r#)
ink rgb (0,0,225),0
set text to bold
set text size 30
text 1215,980,"100"
S#=MOUSEMOVEX()
TEXT 0,0,STR$(S#)
SET TEXT SIZE 20
` Store Object angle
AngleY# = object angle Y(3)+S#/3
Yrotate object 3,Wrapvalue(AngleY# )
X# = Object position x(3)
Z# = Object position z(3)
Position object 3,X#,Y#+12.5,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,100)
CameraX# = Newxvalue(X#,AngleY#-180,100)
Position camera CameraX#,CameraY#+170,CameraZ#
Point camera X#,130,Z#
Loop
thanks guys
A child's dream never dies.