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
0 registered members (), 938 guests, and 4 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
BoneRotate to! #187699
03/09/08 17:46
03/09/08 17:46
Joined: Nov 2006
Posts: 193
England
RyuShinji Offline OP
Member
RyuShinji  Offline OP
Member

Joined: Nov 2006
Posts: 193
England
How do i make a players bone face a paticular point regardless of the players pan?

this is my unsuccessful code:

vec_to_angle(temp,gun_target.x);
ent_bonerotate(my,"bone",temp);

Last edited by RyuShinji; 03/09/08 19:19.
Re: BoneRotate to! [Re: RyuShinji] #187700
03/19/08 17:52
03/19/08 17:52
Joined: May 2007
Posts: 46
R
ribsribs Offline
Newbie
ribsribs  Offline
Newbie
R

Joined: May 2007
Posts: 46
Hey!

3DGS manual have an example for this.

Let's assume that you want the head to turn to an entity called LookAtMe and we're acting within the player assigned action (so we can use MY):

while(1)
{
var HeadPan;
vec_set(temp,LookAtMe.x);
vec_sub(temp,my.x);
ent_bonereset(my, "neckbone");
vec_to_angle(HeadPan.pan,temp);
ent_bonerotate(my,"neckbone", HeadPan);
wait(1);
}

First we assign the position of the target to "LookAtMe" pointer.
Then we subtract our position from the target position.
Then we compute the angle from the resultant direction vector.

I've got a simillar code working in a space game, where a little camera looks toward comets, but i think the angles are not correct all the time... Hopefully someone more experienced will correct me and we both learn something more xD

Re: BoneRotate to! [Re: ribsribs] #187701
03/19/08 18:46
03/19/08 18:46
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
while(my != NULL)
{
ent_bonereset(my, "neckbone");
vec_for_bone(temp,my,"bone");
vec_sub(temp,target.x);
vec_to_angle(temp,-temp);
ent_bonerotate(my,"neckbone",temp);
wait(1);
}

Last edited by flits; 03/19/08 18:46.

"empty"

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