vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d

Posted By: Pappenheimer

vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/22/11 11:28

Hello!
I'm the one who is supposed to miss the obvious, the always beginner.

Maybe, it is worth to add some hints in the manual, because their are others who miss the obvious, but who are afraid to confess their dullness.

Please have a look in this thread, it includes a full script to test the vec_for_normal and vec_for_vertex issue that I had:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=380885&#Post380885
Posted By: Aku_Aku

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/22/11 11:37

I confess i am not totally dull to the vec... functions that you listed up.
I had to fight with them when i made my 3D_pick_and_drop_with_mouse function. Unfortunately i forgot what did, so it wasn't ingorance from my side when i didn't try to help to you.
Posted By: Pappenheimer

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/22/11 14:28

Forgetting about what was once familiar is a given mistake I do so often, that I decided to write small standalone scripts, where anyone can immediately see and test certain functions.
Posted By: jcl

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 08:54

vec_for_vertex and vec_for_normal both use world coordinates and behave exactly as described - I've checked the code to make sure. So, the manual is not to blame in this case.
Posted By: Pappenheimer

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 11:47

Maybe, its a matter of interpretation.
When I read 'world coordinates', I think that I get values that are independent of the object's orientation.
Posted By: Quad

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 12:03

values independent of object's orientation are local coordinates. they are relative to object and to not change when object transforms. They take object's origin as 0,0,0

world coordinates, are absolute positions of vectors, they take worlds origin as 0,0,0
Posted By: Pappenheimer

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 12:34

grin Your explanation is confusing me even more!

Different example:
When I say, the passenger looks to the north - his view direction is described in world coordinates, right? Its, because his view direction is described _independently_ of any object's orientation. Its an absolute value.
When I say, the passenger looks out of the left window of the bus - his view direction is described relativ to the bus' orientation - means, it is relativ to the bus. To get the world coordinate I need the orientation of the bus, means it is a relative value.

(I'm curious, what's the mistake in my definition.)
Posted By: jcl

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 14:58

World coordinates are always given relative to the world origin and orientation, while local coordinates are always given relative to the entity origin and orientation.

For instance, when your passenger faces north, his view angle in world coordinates is 90 degrees. But in local coordinates it's 0 degrees because he's looking straight ahead.
Posted By: Pappenheimer

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d - 08/23/11 15:45

Right.
Means, if the bus turns about 180 degrees, and the passenger still looks straight ahead(within the bus), the passenger doesn't face anymore north in world coordinates, but south.

While the 'passengers' of the sphere - vec_for_vertex and vec_for_normal - keep their values after the turning of the sphere, what is relatively to the sphere absolutely okay, but it is not consistent in world coordinates, because their world coordinates changed.
© 2024 lite-C Forums