Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Inconsistent object positions - what am I doing wrong?

Author
Message
Devil Master
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 18th Jul 2003 22:22 Edited at: 18th Jul 2003 22:29
Check out this code: it's giving me the strangest of problems!

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!

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Jul 2003 23:35
Not got time to run your program right now, but my guess is that the cube is inside the big sphere!

TDK
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Jul 2003 23:38 Edited at: 18th Jul 2003 23:49
Actually, I just ran it and it dies when you hit the cursor keys. You need to use WrapValue instead of If..Then statements.

Edit:

The camera is at 0,0,0 and the cube is at -500, so it's behind the camera - not inside it. I reduced the size of the sphere to see it, so it's probably a combination of this and my first thought, that it was inside the sphere.

I also didn't read the post properly either (sorry). On mine, the sphere appears fine - the cube was missing!

Don't forget to use AutoCam Off if you don't want the camera to spin round and point ant any new object created.

TDK
Devil Master
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location:
Posted: 19th Jul 2003 00:19
Quote: "Don't forget to use AutoCam Off if you don't want the camera to spin round and point ant any new object created."

Thank you, THAT was the problem! (I also modified twice the position of the cylinder and never the position of the cone :doh: )

Login to post a reply

Server time is: 2025-05-19 10:20:51
Your offset time is: 2025-05-19 10:20:51