How to calculate best position/rotation of small objects in order to stay within the bounds of a large box?
Hey,
I'm playing around with an idea where I have a number of small objects placed onto a tray (lets say a flattened cube). I would like to find a way to lay the objects out on the tray with equal spacing between their bounds and also stay within the tray's bounds. I'm only concerned with the X and Z axes here so you can imagine that I'm looking at this scenario from the top-down view, and so the objects can only be rotated along their Y-axis. I would like the objects to have rotations at 90 degree intervals (ie. angle % 90 = 0). I am trying to create a script where I can, for example, press a button which re-arranges the objects on the tray in different, random configurations each time.
Any help with this would be great. Thanks
Your answer
Follow this Question
Related Questions
Given volume dimensions and direction, how to determine if Vector3 is contained 2 Answers
Making non-gui progress bar 0 Answers
Addforce to Z axis rotation via touch input/ mobile 0 Answers
Trying to rotate my character to follow the terrain 0 Answers
How do you disallow an angle from going to a certain range while rotating? 0 Answers