Check out this code: it's giving me the strangest of problems!
Hide Mouse
Sync On
Color Backdrop Rgb(0,0,0)
Set Camera Range 1,500000
Position Camera 0.0,0.0,0.0
Make Object Sphere 1,10000 : Position Object 1,0.0,-250.0,10000.0
`Make Object Cube 2,50 : Position Object 2,0.0,0.0,-500.0
`Make Object Cylinder 3,100 : Position Object 3,500.0,0.0,0.0
`Make Object Cone 4,100: Position Object 3,-500.0,0.0,0.0
Set Ambient Light 0
Sync Rate 0
rylos_spin#=0
Do
rylos_spin#=rylos_spin#+0.1
If rylos_spin#>360 Then rylos_spin#=rylos_spin#-360
Yrotate Object 1,rylos_spin#
If Upkey()=1
xcamera#=xcamera#+2
If xcamera#=362 Then xcamera#=2
Xrotate Camera xcamera#
Endif
If Downkey()=1
xcamera#=xcamera#-2
If xcamera#=-2 Then xcamera#=358
Xrotate Camera xcamera#
Endif
If Leftkey()=1
ycamera#=ycamera#-2*Cos(xcamera#)
zcamera#=zcamera#-2*Sin(xcamera#)
If ycamera# < 360 Then ycamera#=ycamera#-360
If zcamera#>360 Then zcamera#=zcamera#-360
Yrotate Camera ycamera#
Zrotate Camera zcamera#
Endif
If Rightkey()=1
ycamera#=ycamera#+2*Cos(xcamera#)
zcamera#=zcamera#+2*Sin(xcamera#)
If ycamera# < 360 Then ycamera#=ycamera#-360
If zcamera#>360 Then zcamera#=zcamera#-360
Yrotate Camera ycamera#
Zrotate Camera zcamera#
Endif
Sync
Loop
When I run it, I see a nice spinning sphere in front of the camera. BUT...
...look at the commented lines now. Uncomment the first one and run the program again.
WHERE THE HECK IS THE SPHERE?!?!
If you rotate the view to left and right with the arrows, you will be sometimes able to see parts of the sphere, but nothing else, and especially
not the CUBE that should appear at 0.0,0.0,-500.0 .
Uncomment the second line now. There's the sphere again, but it's
much closer to the camera than before! Well, at least the cube and the new-made cylinder are in the right position.
Uncomment the last commented line now. Run the program... the line says that a cone should appear on the left of the camera, right?
Unfortunately, the cone appears
in front of the camera!
Why does this happen? I can't imagine what I'm doing wrong!