Sorry, I don't mean to be a pest by posting this in both the beginners area and here, but I thought I'd try anyway. If that's a breach of conduct, please let me know.
I have a quick question regarding cameras in Blitz3D. My problem might have to do with the fact that I am misunderstanding the way AlignToVector and MoveEntity commands work. Here's a bit of code to illustrate my problem:
I wanted it to work so that when I scroll up on the mouse button (just one click should do), it moves the camera up and tilts it down on the cube. When I scroll back (again, a single click should do), I want it to _perfectly reverse_ that motion. However, I find that when I scroll back, it doesn't bring the camera back to its starting point! What gives?
If you could offer any help, I'd greatly appreciate it.
Thanks,
-- DJ3J, once again showing just how much of a beginner he really is.
I have a quick question regarding cameras in Blitz3D. My problem might have to do with the fact that I am misunderstanding the way AlignToVector and MoveEntity commands work. Here's a bit of code to illustrate my problem:
Graphics3D 800,600 SetBuffer BackBuffer() Global mx,my,mz,mzspd,rotup,ticker,camera camera = CreateCamera() PositionEntity camera,0,-15,-5 TurnEntity camera,-90,0,0 light = CreateLight() cube = CreateCube() Function UpdateCamera() If mzspd > 0 rotup = 1 ElseIf mzspd < 0 rotup = -1 EndIf If rotup = 1 And ticker < 60 AlignToVector camera,0,.01,0,2,.01 MoveEntity camera,0,.1,.1 ticker = ticker + 1 ElseIf rotup = -1 And ticker < 60 AlignToVector camera,0,-.01,0,2,.01 MoveEntity camera,0,-.1,-.1 ticker = ticker + 1 EndIf If ticker = 60 rotup = 0 ticker = 0 EndIf End Function While Not KeyHit(1) mx = MouseX() my = MouseY() mz = MouseZ() UpdateWorld RenderWorld UpdateCamera() mxspd = MouseXSpeed() myspd = MouseYSpeed() mzspd = MouseZSpeed() If MilliSecs()<timer+1000 Then frame=frame+1 Else fps=frame frame=0 timer=MilliSecs() End If Flip Wend End
I wanted it to work so that when I scroll up on the mouse button (just one click should do), it moves the camera up and tilts it down on the cube. When I scroll back (again, a single click should do), I want it to _perfectly reverse_ that motion. However, I find that when I scroll back, it doesn't bring the camera back to its starting point! What gives?
If you could offer any help, I'd greatly appreciate it.
Thanks,
-- DJ3J, once again showing just how much of a beginner he really is.