Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 07/22/26 06:42
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 1,397 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Normal's ANGLE [Re: 3run] #350750
12/18/10 21:24
12/18/10 21:24
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"You are saying that normal is always stands in 90 degrees, what you mean by that?" =>
Originally Posted By: Superku
The normal stands always in a right angle [= 90°] on the surface, that's the definition of a normal.

Suppose that you have two vectors, v1 and v2. Then your angle can be calculated as follows:
my_angle = acos((v1.x*v2.x+v1.y*v2.y+v1.z*v2.z)/(vec_length(v1)*vec_length(v2));


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Normal's ANGLE [Re: Superku] #350755
12/18/10 21:53
12/18/10 21:53
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Thank you so much Superku laugh
Just one more question, where do I get that two vectors?
I need to set surface's angle, to do not allow player climb surfaces with a high angle.
So I'll use 'c_trace' to detect surface under player's feet (normal (only now I got what was meant by "right angle", really hard to learn Maths in English for me)).
But where do I get two vector's? Thank you one more time.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Normal's ANGLE [Re: 3run] #350759
12/18/10 22:04
12/18/10 22:04
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Save the normal from your gravity trace in another VECTOR, f.i.
VECTOR normal_save;
...
c_trace(...)
vec_set(normal_save,normal);

When you now collide with a wall, the normal vector will be set to the collision surface's normal. Compare those two vectors.


Besides, you do not need to do that at all, because you normally only trace vertically down (or up). Then just check the normal.z value of the wall (see manual).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Normal's ANGLE [Re: Superku] #350818
12/19/10 13:18
12/19/10 13:18
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Thank you Superku, but manual says that normal.z can be between 1 and -1 only.
And what is "ceiling plane"? I tried to translate it into my mother language, but it translate it as a celling...
If I need to prevent player climbing surfaces with big angle, do I need to make sure that normal.z is bigger that 0.5? Thank you one more time.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Normal's ANGLE [Re: 3run] #350819
12/19/10 13:20
12/19/10 13:20
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
"do I need to make sure that normal.z is bigger that 0.5?"

Exactly! But don't forget you only have to do that when you collide with a wall, otherwise normal.z can have random values from previous c_trace/ c_move instructions.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Normal's ANGLE [Re: Superku] #350821
12/19/10 13:29
12/19/10 13:29
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
So I'll need to use EVENT_BLOCK too detect colliding, and I right?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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