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.

Dark GDK / object positioning problem

Author
Message
Slim Pimpin
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: lost in the web
Posted: 5th Jan 2008 03:18
i am having a problem positioning a sphere for a program i am working on. what i want is a sideways sphere (just the circle showing) in the center of the screen with the cam going around it. the way it is now the object is going around the cam and the cylinder is in the vertical position



Pimpin aint eazy
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 6th Jan 2008 02:42 Edited at: 6th Jan 2008 02:43
Looking at your code I can't see why this doesn't produce a circular motion of the camera around the central object, which is obviously what you've set out to do.

Try adding the following dbPointCamera command to point it back to the center again after you move the camera back again:



This appears to work however the distance now seems to gradually reduce. Not convinced the dbMoveCamera command is working quite as described!

No matter how good your code is, someone will improve on it
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 6th Jan 2008 10:53 Edited at: 6th Jan 2008 10:56
Hey guys,

Actually, the problem is simpler than that. At the beginning of your code you need to call dbAutoCamOff(). Otherwise the camera gets repositioned when you make any new object. It's my fault if you're using my example in the Challenge thread to learn from. The example is fixed now. Sorry for causing the headache!

Hope this helps!
-Frank

[edit]
I also noticed that you make the following call repeatedly inside your loop:



You only need to call that once unless you're changing the angle of rotation. It rotates the angle TO 90.0 degrees not BY 90.0 degrees (if that makes sense).
[/edit]

Login to post a reply

Server time is: 2024-11-19 23:01:20
Your offset time is: 2024-11-19 23:01:20