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.

Author
Message
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 6th Jun 2009 01:03
Hello, im not too good with 3d, but i want to learn,

ive written this bit of code but ive ran into, what i think, is a strange problem.



if you ran this you would see that once you pass around 180 degrees the camera turns in the wrong direction. can anybody please explain this? thanks

Omricon W.I.P
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 6th Jun 2009 08:28
Your problem exists in the commands you use to turn the cube. The turn object right, left, etc commands are intended to rotate an object independent of any axis. And so, when doing something so seemingly harmless as turning the cube left, you could actually be affecting all three axes. Actually, that's exactly what happens. In this case, when you turn the cube right or left to +/- 90 degrees, the object's angles about the other two axes flip. I'd just avoid this by using something like this to turn your cube:
Vathelokai
15
Years of Service
User Offline
Joined: 3rd May 2009
Location:
Posted: 6th Jun 2009 09:03
It's the "set camera to follow" command that is causing it. The angle you are providing "object angle y(1)" should be changed to something else, but I'm not sure what. Changing it to "180" gave better results, but still not great.

...

Try this version. I think it's what you are looking for.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 6th Jun 2009 15:47
Thank you Kira Vakaan
that bit of code worked perfectly
ill remember not to use turn object in the future

Omricon W.I.P
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 6th Jun 2009 20:15
@Vathelokai:
Quote: "It's the "set camera to follow" command that is causing it."


It's not. Your snippet works fine like this:


@Mad Nightmare:
Glad that did the trick.
But I didn't mean to turn you off to those functions entirely. I mean, they do have their uses.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 7th Jun 2009 17:07 Edited at: 7th Jun 2009 17:11
hey, this is the same code, but ive added to it, so i guessed i should post here too. well ive changed the cube to a cone so i can see what direction its facing, but unless its just my comp, the cone seems to be disappearing..

help please?

Edit:
I removed the pivot code and it works fine, any ideas?

Omricon W.I.P
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 7th Jun 2009 17:14
ahh, now i have problems with this, same problem, its disappearing.



Omricon W.I.P
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 7th Jun 2009 17:55
the cone has no bottom face. that means, it has no polygon at its bottom. if you make the cone a box, you'll see that it just works. if you want to use a cone, make one in a moddeling program and make sure it has a bottom polygon cause dbp doesn;t generate one.

*ding ding*
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 7th Jun 2009 20:46
oh right, thanks

Omricon W.I.P

Login to post a reply

Server time is: 2024-11-25 06:52:24
Your offset time is: 2024-11-25 06:52:24