Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bone rotate #130838
05/20/07 18:25
05/20/07 18:25
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
A time ago I posted a similiar question on this forum about bone rotation. The response on that post resulted in the following code, which worked for my previous project. But now I implemented it in a other project and now I get weird results. Here's the code;

var temp3[3];
var temp4[3];
var bone_angle[3]; // a vector that will hold the pan, tilt and roll angles
temp3.x = (screen_size.x / 2);
temp3.y = (screen_size.y / 2);
temp3.z = 10;
vec_for_screen(temp3,camera);

temp4.x = (screen_size.x / 2);
temp4.y = (screen_size.y / 2);
temp4.z = 8000;
vec_for_screen(temp4,camera);

trace_mode = ignore_me+ignore_passable;
target = trace(temp3,temp4);


var tPos[3];
var tAng[3];
ent_bonerotate(my, "bone22", nullvector);
vec_diff(tPos, Target, my.x);
vec_to_angle(tAng, tPos);
vec_sub(tAng, my.pan);
ent_bonerotate(my, "bone22", tAng);

The function should rotate bone22 in such way it points to the target position. The target is based on a trace between two points in the camera view. When I use this code in my new project it rotates the bone22 in every direction. Hope someone can tell me what's wrong with my code? Thanks anyway, Molotov.

Re: bone rotate [Re: molotov] #130839
05/20/07 20:51
05/20/07 20:51
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
you have to reset the bone every frame to it's original position again.
ent_bonereset_all or something it's called.
look it up in the manual.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: bone rotate [Re: Helghast] #130840
05/21/07 07:21
05/21/07 07:21
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Thanks dennis_fantasy for your fast reply. Anyway putting ent_bonereset in it doesn't help, i've already tried that. Thanks anyway, Molotov.

Re: bone rotate [Re: molotov] #130841
05/21/07 11:02
05/21/07 11:02
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
This is a FPP or TPP ?

1. IF FPP you can trace from player and not from camera
2. If TPP you may trace from camera not from 10 quants front of camera
Maybe something like this:
Code:

ent_animate(me,NULL,0,0);
vec_set(temp,target.x);
vec_sub(temp,my.x);
vec_to_angle(tAng,temp);
ent_bonarotate(my,"bone22", tAng);



Last edited by tompo; 05/21/07 11:21.

Never say never.
Re: bone rotate [Re: tompo] #130842
05/21/07 13:43
05/21/07 13:43
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Hey Tompo, thanks for your reply. Your code does the same as my code part. The effect what occurs is that the bone22 pan's according to the camera.pan. What I want is that the bone22 tilt's according tot the camera.tilt. And then points towards the target.x. Hope this makes any sense.

By the way, it's a TPP and I changed the 10 quants to 1000, but it still doesn't work. Thanks anyway, Molotov.

Re: bone rotate [Re: molotov] #130843
05/24/07 09:00
05/24/07 09:00
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Is there anyone that can help me, help would be much appreciated. Thanks anyway, Molotov.


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