Hello everyone
It's been a little while since my last post. Been busy practicing modeling before getting into the programming. Anyway, I was trying to achieve an efect I have seen in some games: a floating camera. In some games, the camera seems to float up and down, like it was floating on water.
I typed the following code, but nothing happens. Could someone help me?
The point is to make the camera's Y position increase all the way to five, and then all the way to -5. Any help will be appreciated. Thanks.
It's been a little while since my last post. Been busy practicing modeling before getting into the programming. Anyway, I was trying to achieve an efect I have seen in some games: a floating camera. In some games, the camera seems to float up and down, like it was floating on water.
I typed the following code, but nothing happens. Could someone help me?
Graphics3D 800,600,16,2 SetBuffer BackBuffer() cam = CreateCamera() PositionEntity cam,0,2,0 piso = CreatePlane() pisotex = LoadTexture("comp002.jpg") EntityTexture piso,pisotex FreeTexture pisotex UpdateWorld RenderWorld Flip Function FloatCamera(camera,speed) dir = "up" u=u+1 y# = EntityY(camera) If dir = "up" y# = y# +0.5 MoveEntity camera,0,y#,0 If y# = speed Then dir="down" End If If dir="down" y# = y# - 0.5 MoveEntity camera,0,y#,0 If y# = (speed *-1) Then dir="up" End If End Function ;main loop While Not KeyDown(1) FloatCamera(cam,5) UpdateWorld RenderWorld Text 0,0,Str(EntityY(cam)) Flip Wend End
The point is to make the camera's Y position increase all the way to five, and then all the way to -5. Any help will be appreciated. Thanks.