Archived

This topic is now archived and is closed to further replies.

billybob

rotating parts around a common point?

Recommended Posts

i have a car, my modeler made it into 15 parts so each one can be damaged individually. i need to know how to rotate and move all the parts so they ''stay together'' without going out of sync. i know how to render them without breaking them apart, but not do physics on it (the tires only need the physcis) how would i go about that?

Share this post


Link to post
Share on other sites
Gosh, billybob you''ve been asking a lot of questions. that''s a good thing though, don''t get me wrong. :-)

About the q, are the 15 parts touching? (ie: windshield and frame) or are they seperate? (ie: tire and frame). What are the 15 parts? If they''re touching, you can''t get away with just transforming them. BTW, use a frame-based setup for the car, it makes everything easier. Anyways, if they are touching, you have to a bit of math to calculate what should happen. If i were u, I''d setup control points along the car. Then before you render, adjust the vertices (probly in a vshader doing math like would bones) so that they fit the control points. If the control poitns move, the vertices should move to adjust it. That way you can life up the hood or whatever else based on the physics from the crash.

Many companies that make car games don''t do this though. They may create 15 different car frames of the different crashes and positions with one set of tires and stuff and just render the car frame differently based on the crash. That way is a lot faster although it stores more memory if that''s an issue for u.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org

Share this post


Link to post
Share on other sites
quote:
Just for my own edification, why would transforming the parts if they were touching be such an imposibility?


By transforming, I meant rotating, scaling, and translating them. It would be VERY difficult is not impossible in some situations. The reason is because lets say you rotate the windshield on the y axis. Well no there''s a hugh, noticibly gap between the frame and windsield and not to mention that it isn''t realistic at all. Yea, you can do it but it wouldn''t be realistic and would have large ugly unrealistic gaps.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org

Share this post


Link to post
Share on other sites
quote:
Original post by RapidStunna
Gosh, billybob you''ve been asking a lot of questions. that''s a good thing though, don''t get me wrong. :-)

About the q, are the 15 parts touching? (ie: windshield and frame) or are they seperate? (ie: tire and frame). What are the 15 parts? If they''re touching, you can''t get away with just transforming them. BTW, use a frame-based setup for the car, it makes everything easier. Anyways, if they are touching, you have to a bit of math to calculate what should happen. If i were u, I''d setup control points along the car. Then before you render, adjust the vertices (probly in a vshader doing math like would bones) so that they fit the control points. If the control poitns move, the vertices should move to adjust it. That way you can life up the hood or whatever else based on the physics from the crash.

Many companies that make car games don''t do this though. They may create 15 different car frames of the different crashes and positions with one set of tires and stuff and just render the car frame differently based on the crash. That way is a lot faster although it stores more memory if that''s an issue for u.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org


i know, and i get a lot of answers

one thing i''m doing, all the parts(exludign the tires) never need to move independantley of the main body(what all my physics crap gets done to). the only thing that can move are the tires, and even then they are only moving in one axis. so what i had my friend do is export all the parts as different.x files but making ABSOLUTLEY sure that he kept the origin EXACLTY where it was reletive to the body. that way, when i rotate, they rotate together. its only the tires that i need help with.

Share this post


Link to post
Share on other sites