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
0 registered members (), 1,103 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Attached a gun to player's hand but it is turning! #422215
05/05/13 10:27
05/05/13 10:27
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Hi,

I need to attach a model to another model. I don't know the engine enough, so I started to search for it. I found a little code for attaching using with vertex/bone. Link is here;

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&topic=46005&gonew=1

Then I tested it, it works. But there is a problem as he said. The model is turning while my character animating.

In that topic "Superku" is talking about using a third vertex and set the gun's roll with that vertex. I stucked in that part. I can't make it.

How can I change model's roll with a functions like vec_to_angle ? vec_to_angle is computing only pan and tilt. But I need changing roll. I tried something like

Code:
vec_for_vertex (my.skill1, player, 33);
		vec_for_vertex (my.skill4, player, 10);
		vec_diff (my.skill7, my.skill4, my.skill1);
		vec_to_angle (my.pan, my.skill7);
		vec_set (my.x, my.skill1);

 my.roll = 0;



It doesn't works.

I selected another vertex for roll. The vertex number is "31".

I hope you can help me. Thanks in advice.

Re: Attached a gun to player's hand but it is turning! [Re: WickWoody] #422226
05/05/13 17:05
05/05/13 17:05
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Oh, I made it again with bones and it works. There are two basic functions for that. vec_for_bone and ang_for_bone. There is the code;

Code:
vec_for_bone(my.x, player, "el");
		ang_for_bone(my.pan, player, "el");


Re: Attached a gun to player's hand but it is turning! [Re: WickWoody] #422228
05/05/13 19:55
05/05/13 19:55
Joined: Mar 2013
Posts: 30
Portugal
J
joao13pt Offline
Newbie
joao13pt  Offline
Newbie
J

Joined: Mar 2013
Posts: 30
Portugal
Its not very wise to go for vertex
ALWAYS go for bones, it's much easier


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