hi folks,
just a quickie this one. I am playing about with 3d now and am creating a FPS style camera that turns and pans in accordance with the mouse x and y.
I am storing the mousex and y co-ordinates in a temp variable then comparing these to teh new mouse x and y values on the next frame. if they change then the camera turns accordingly. IE:
Global tempmx = 0
Global xdiff = 0
While Not KeyDown( 1 )
xdiff = tempmx - MouseX()
TurnEntity camera,0,xdiff* speed,0
RenderWorld
Flip
tempmx = mousex()
wend
i have only cut the relevent bits from my code here, so i know there is no graphics set up etc in this example, but u get the idea :D. anyway, the problem is, when the mouse goes off the screen, it doesnt seem to register the mousex() anymore, so it will only turn about 45 degrees from full left to full right. Can anyone tell me how to compensate for this easily? I could write a small function to do it, but i was wondering if there was a built in command or such that could do it. Thanks for any help (again :D)
~V~
Oh, and while i am here, can anyone tell me what the units are that blitz measures 3d space in? ie:
translateEntity 0,5,0
5 what? feet, inches? elephants lol.... thanks
just a quickie this one. I am playing about with 3d now and am creating a FPS style camera that turns and pans in accordance with the mouse x and y.
I am storing the mousex and y co-ordinates in a temp variable then comparing these to teh new mouse x and y values on the next frame. if they change then the camera turns accordingly. IE:
Global tempmx = 0
Global xdiff = 0
While Not KeyDown( 1 )
xdiff = tempmx - MouseX()
TurnEntity camera,0,xdiff* speed,0
RenderWorld
Flip
tempmx = mousex()
wend
i have only cut the relevent bits from my code here, so i know there is no graphics set up etc in this example, but u get the idea :D. anyway, the problem is, when the mouse goes off the screen, it doesnt seem to register the mousex() anymore, so it will only turn about 45 degrees from full left to full right. Can anyone tell me how to compensate for this easily? I could write a small function to do it, but i was wondering if there was a built in command or such that could do it. Thanks for any help (again :D)
~V~
Oh, and while i am here, can anyone tell me what the units are that blitz measures 3d space in? ie:
translateEntity 0,5,0
5 what? feet, inches? elephants lol.... thanks