Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (AndrewAMD), 1,244 guests, and 3 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
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 | 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