Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, 1 invisible), 858 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d #380886
08/22/11 11:28
08/22/11 11:28
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Pappenheimer] #380889
08/22/11 11:37
08/22/11 11:37
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
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.

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Aku_Aku] #380909
08/22/11 14:28
08/22/11 14:28
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Pappenheimer] #380968
08/23/11 08:54
08/23/11 08:54
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: jcl] #380993
08/23/11 11:47
08/23/11 11:47
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Pappenheimer] #381000
08/23/11 12:03
08/23/11 12:03
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
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


3333333333
Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Quad] #381003
08/23/11 12:34
08/23/11 12:34
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.)

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: Pappenheimer] #381036
08/23/11 14:58
08/23/11 14:58
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

Re: vec_for_normal, vec_for_vertex, mouse_pos3d, mouse_dir3d [Re: jcl] #381044
08/23/11 15:45
08/23/11 15:45
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline OP
Senior Expert
Pappenheimer  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
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.


Moderated by  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1