- Home /
Stretching a mesh between two meshes
Given two square meshes of the same size and positioned in the same place (except in their local-y), and rotated 180 of each other, I want to stretch and position 4 other meshes (rotated appropriately) to fill in the sides. The effect will be a stretching cube. Yes, I realize this would be easier as just a cube object. The project will require that I have the objects independent of each other at another point in the project. I've tried tackling the math for this, but have failed. I wanted to see if anyone out there with more experience could give me some pointers. The rotations of the objects and the local to global translations seem to be what are hanging me up.
Will the top and bottom rotate, or just move apart in Y? $$anonymous$$ove in x,z?
They top and bottom will always be aligned perfectly to each other, and filpped 180 degrees. The way you would normally construct two ends of a box. Therefore, they will not be rotated aside from being flipped, and will be aligned in the other axes besides their Y. That said, however, the boxes themselves may be oriented in any direction (the two panels may be the top and the bottom, or may be the front and the back, etc. Also, the panels are all separate, non-parented objects. Hence why this is a particularly troublesome problem for me.
Answer by DaveA · Dec 09, 2011 at 10:20 PM
Ok I would put 6 Planes under one parent. Arrange the 6 planes into a cube. If you don't like the overly-complex plane Unity provides, model a quad an import it. Then you can transform that parent any way you like, it will still be cube-like. Then changing the parent's Y scale will stretch those 4 sides as you described.
No can do. These walls need to stay unparented and separate :-(
Your answer
Follow this Question
Related Questions
stretching UV's on terrain 2 Answers
Aligning Y-Axis rotation of stretched gameobject to specific angles while retaining initial position 0 Answers
How can I rotate the player to fixed rotation? 1 Answer
How to aply force to parent gameObject using childs local space coordinates? 0 Answers
World Coordinates of BoxCollider2D ? 1 Answer