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 (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: walking on walls -- alignToVec [Re: Alan] #292094
09/30/09 10:18
09/30/09 10:18
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Hi Alan!

I'm glad you were able to resolve the issue before I got a chance to see the question grin But still if there are any questions, don't hesitate.

Thanks everyone for the support laugh

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: walking on walls -- alignToVec [Re: JibbSmart] #351268
12/23/10 04:26
12/23/10 04:26
Joined: Jun 2010
Posts: 21
Canada
G
GnR Offline
Newbie
GnR  Offline
Newbie
G

Joined: Jun 2010
Posts: 21
Canada
Do you have a code example of using this with c_rotate? I am already using c_rotate to adjust the pan on my model and I am trying to use your function to align my model with a slope in the same frame. I'm sure it's simple enough but I'm not getting it.

Re: walking on walls -- alignToVec [Re: GnR] #351335
12/23/10 19:43
12/23/10 19:43
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
I believe it's something like:
Code:
ANGLE tempAng;
vec_set(tempAng, my.pan);
alignToVec(tempAng, normal, vector(0, 0, 1), 1);
vec_sub(tempAng, my.pan);
c_rotate(me, tempAng, GLIDE);


c_rotate adds the rotation to the entity's current orientation, so if we want to align it with an angle, all we need to do is subtract its real orientation first, and then perform the c_rotate with the difference (as shown above).

I don't have time to test it, since I'm about to go on holiday for Christmas with my family laugh

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: walking on walls -- alignToVec [Re: JibbSmart] #351342
12/23/10 20:13
12/23/10 20:13
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
I believe you need the parameter USE_AXIS for c_rotate. c_rotate(....,USE_AXIS) is the same as ang_add, only with collision detection.

Re: walking on walls -- alignToVec [Re: Tobias] #351513
12/26/10 05:15
12/26/10 05:15
Joined: Jun 2010
Posts: 21
Canada
G
GnR Offline
Newbie
GnR  Offline
Newbie
G

Joined: Jun 2010
Posts: 21
Canada
Thank you for the quick answer and example.

And yes USE_AXIS is definitely required in the c_rotate. Appreciate your help.

Page 2 of 2 1 2

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