Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Turn to normal #336566
08/05/10 00:44
08/05/10 00:44
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
I've made a climbing code, and I tried to turn players pan to surface that he's trying to climb on, but I fail, here is what I've tried:
Quote:
vec_for_angle(my.pan,normal);
Picture to explain:



Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Turn to normal [Re: 3run] #336583
08/05/10 07:55
08/05/10 07:55
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg
The Problem is vec_for_angle converts an angle into a vector. IN this case it sets my.pan to a value near 1 and that coincidentally works for the first wall.
What you want is vec_to_angle(my.pan, normal) - after that u might have to set my.tilt -= 90.

Last edited by FlorianP; 08/05/10 07:57.

I <3 LINQ
Re: Turn to normal [Re: FlorianP] #336679
08/05/10 17:40
08/05/10 17:40
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
But why do I need to have my.tilt -= 90? That will turn player down... Or I'm not understanding something...


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Turn to normal [Re: 3run] #336734
08/05/10 21:38
08/05/10 21:38
Joined: Jul 2010
Posts: 129
B
bk9iq Offline
Member
bk9iq  Offline
Member
B

Joined: Jul 2010
Posts: 129
Even when I use c_trace and hit.nx instead of normal only I get the same problem... The normals are facing one way which is the +ve x-axis ....
Any ideas guys why this is happening?

Re: Turn to normal [Re: bk9iq] #336748
08/05/10 22:57
08/05/10 22:57
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg
Sounds like your not hitting the right object/polygon - would be best if you posted your code.

Anyway the general approach would be something like this
Code:
vec_set(temp, vector(50, 0, 0));
vec_rotate(temp, my.pan);
vec_add(temp, my.x);
if (c_trace(my.x, temp, IGNORE_ME | USE_BOX))
{
   vec_to_angle(my.pan, normal);
   my.tilt -=90;
}



Der Normalenvektor zeigt naturgemäß vom der getroffenen Oberfläche weg, setzt man ein standardmäßig ausgerichtetes Modell auf diese Rotation würde es 'auf der Oberfläche stehen'.
my.tilt -=90 (evtl isses auch +=90, bin da grad nich sicher) rotiert den Player sozusagen mit dem Bauch zur Oberfläche.

Last edited by FlorianP; 08/05/10 23:00.

I <3 LINQ
Re: Turn to normal [Re: FlorianP] #336751
08/05/10 23:16
08/05/10 23:16
Joined: Jul 2010
Posts: 129
B
bk9iq Offline
Member
bk9iq  Offline
Member
B

Joined: Jul 2010
Posts: 129
@FlorianP thanks bro very much ... I used ur method except for the
my.tilt -=90;
I used my.pan -= 180; and everything is working just fine...
Thanks again...

@3run ... here's what I used:
Quote:
VECTOR temp1;
vec_set(temp1, vector(50, 0, 0));
vec_rotate(temp1, my.pan);
vec_add(temp1, my.x);
if (c_trace(my.x, temp1, IGNORE_ME | USE_BOX))
{
vec_to_angle(my.pan, normal);
my.pan -=180;
}


Re: Turn to normal [Re: bk9iq] #336807
08/06/10 13:10
08/06/10 13:10
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
Thank you all guys laugh


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

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

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