Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 791 guests, and 5 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
Adding player angle with normals #147791
08/14/07 06:37
08/14/07 06:37
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
I seem to suck at it, apparently. I'm trying to get an entity to move around with zero gravity, but on certain angles it stops turning and is super sensitive. Probably those crazy angles working me over again. Heres the code:

Code:
 
vec_set(temp3.x,nullvector);
vec_to_angle(temp3, normal);
vec_set(temp3.pan,my.pan);
// Adapt the player angle to the floor slope
temp3.TILT = 0;
temp3.ROLL = 0;
temp3.PAN = -MY.PAN;
vec_rotate(normal,temp3);

temp3.TILT = -ASIN(normal.X);
temp3.ROLL = -ASIN(normal.Y);

temp4.TILT = ANG(temp3.TILT-MY.TILT);
temp4.ROLL = ANG(temp3.ROLL-MY.ROLL);
vec_scale(temp4.pan,0.5);
c_rotate(my,temp4.pan,ignore_me);




Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Adding player angle with normals [Re: Stansmedia] #147792
08/14/07 13:49
08/14/07 13:49
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Are you walking on a sphere or something?
Propably a Gimbal Lock Problem.


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: Adding player angle with normals [Re: Captain_Kiyaku] #147793
08/14/07 15:39
08/14/07 15:39
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Yes. Probably. So, somewhere in your movement function place these lines:

player.pan = cycle(player.pan,0,360);
player.tilt = cycle(player.tilt,0,360);
player.roll = cycle(player.roll,0,360);

And see if that helps whatsoever.

Re: Adding player angle with normals [Re: LogantheHogan] #147794
08/14/07 19:56
08/14/07 19:56
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
It stops working when i place your code in, logan. Ugh. I find myself fighting this same problem all the time. :'(


Decessus - 80% done. 100% abandoned.
GET MY ANDROID GAME! https://play.google.com/store/apps/details?id=com.lasertrain.zspinballfree&hl=en
Re: Adding player angle with normals [Re: Stansmedia] #147795
08/16/07 20:54
08/16/07 20:54
Joined: Mar 2003
Posts: 1,524
Canada
Stansmedia Offline OP
Serious User
Stansmedia  Offline OP
Serious User

Joined: Mar 2003
Posts: 1,524
Canada
I cant get the object to roll to the correct orientation, or go upside down.

If gimbal lock was a small animal ide punt it like a football as hard as i could. This is driving me insane.

Last edited by Stansmedia; 08/16/07 23:47.

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