Gamestudio Links
Zorro Links
Newest Posts
zorro with ccxt?
by opm. 03/03/26 03:17
ZorroGPT
by TipmyPip. 03/02/26 18:13
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (alx, opm), 5,223 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Finding the angle of a wall #12937
06/20/03 02:10
06/20/03 02:10
Joined: Aug 2001
Posts: 74
Louisiana, USA
kelly_b_c Offline
Junior Member
kelly_b_c  Offline
Junior Member

Joined: Aug 2001
Posts: 74
Louisiana, USA
If you are asking about the concept of "normal" I might can explain that a little bit.

Normal basically means perpendicular. So the surface normal is a vector (like a line) that extends from a surface at a 90 degree angle.

Hmm, pictures would help I guess.

Imagine you have a surface representing a horizontal floor. The normal to the floor would be a vertical vector.

^
| <-- This vector is normal to the floor
|
_________ <-- This is suppose to be the floor

Or is you had a vertical wall, then normal to the wall would be a horizontal vector.

| <--This is the wall
|
|-----> This vector is normal to the wall
|
|

of course you can have a normal to any surface at any angle, these are just the simplest examples. Maybe that will help some, I hope.

Re: Finding the angle of a wall #12938
06/20/03 06:04
06/20/03 06:04
Joined: May 2002
Posts: 82
thrasher4556 Offline OP
Junior Member
thrasher4556  Offline OP
Junior Member

Joined: May 2002
Posts: 82
so the normal is 90 degrees all around the surface it is perpendiculat to? What exactly do you mean the vector is perpendicular to the surface? How is i perpendiculat ? you mean the values .x .y .z? or .tilt .pan . roll?

Re: Finding the angle of a wall #12939
06/21/03 03:12
06/21/03 03:12
Joined: May 2002
Posts: 82
thrasher4556 Offline OP
Junior Member
thrasher4556  Offline OP
Junior Member

Joined: May 2002
Posts: 82
I am making a race car bot and i want it to trace 100 quants ahead of it all the time and if it finds a wall to turn to the angle of that wall (be parallel to it), so i have this in a loop with a wait(1) at the end:

trace_mode = ignore_passable + ignore_models;
trace_to.x = my.x + (100 * cos(my.pan));
trace_to.y = my.y + (100 * sin(my.pan));
the_result = trace(my,trace_to);
if (the_result != 0) // if it found a wall
{
vec_to_angle(the_result_angle.pan, normal);
my.pan = the_result_angle.pan + 90;
}

then under that i have the code to move it foward according to its pan. It doesnt work. Can any one help?

Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

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