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 / simple use of vector3

Author
Message
solo
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 13th Nov 2005 06:51
Why do I get a value of length = 0 though the camera(0) and object(1) are positioned in different coordinates?

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 13th Nov 2005 20:00
Maybe you should try to define distCameraToSubject at the beginning of the code.

This works for me:



Although, shouldn't the end distance equal to 400 (500-100)? Uh.
Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 13th Nov 2005 23:20
The code you've posted is fine, I'm guessing the error lies in the set up beforehand. Have you called dbMakeVector(1) before calling dbSetVector()? Another thing to check is that object 1 is created before you call the dbObjectPosition(1) commands.

I managed to make both of those errors while testing your code snippet and that gave me 0.0 as the answer too

Kaiyodo.
solo
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 14th Nov 2005 21:15
Kaiyodo thanks,
My bad. The vector was set but hadn't been created...

Login to post a reply

Server time is: 2024-11-19 02:34:04
Your offset time is: 2024-11-19 02:34:04