rotating parts around a common point?

Started by
5 comments, last by billybob 21 years, 8 months ago
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?
Advertisement
sorry accidental double post.

[edited by - SysOp_1101 on July 29, 2002 10:33:30 PM]
SysOp_1101
Why not just have a single matrix that each part of the car contains a reference to? Then you could just rotate/translate each part of the car by the common matrix.

Just a stab in the dark. HTH
SysOp_1101
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
Just for my own edification, why would transforming the parts if they were touching be such an imposibility?
SysOp_1101
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
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.

This topic is closed to new replies.

Advertisement