Skip to main content
gamedev.net
🔒 Locked

How to align two objects

Started by QuadMV 0 replies 400+ views
Original Post
QuadMV
QuadMV
I’m not sure if this is the right forum, but I think it is. I have two models and each model has a poly that won’t get rendered but instead is used to mark the point of alignment. I need to rotate object two so its poly is aligned with object one. Then I need to move object two up or down so they match exactly and the two poly’s overlap. Also, this rotation should only be necessary along the Y axis, neither the Z or X should rotate, as both objects are on the same plane. Can anyone help me with how to do this? I think it’s similar in some ways to a billboard, but even billboards have been difficult for me. Thanks
3DMUVE is an amateur game development team, and the designer and developer of a new gaming technology “MUVE” for the gaming industry.
Antheus
Antheus
Pick anchors on each poly (edge, and a point on this edge).

Move one poly so that its anchor point matches the other poly's anchor point.

Calculate the angle between anchor edges. Rotate one poly by this angle. And you get two aligned polys.

You might need to check for inside/outside, so you don't overlap them.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.