Hi guys,
I am trying to script four prims to make a pyramid shape, and I am having all kinds of trouble with calculating rotations.
I tried it manually without success, and I am sure there must be a simple formula for working it out, if anyone has it.
Imagine a flat square prim on the ground, the base. Imagine then a prim 2x2x10 and I want to place that at one corner of the base, and the other end touching the highest apex point of the base that it can.
I have worked out the rotations mathematically. I need to rotate the prim first horizontally by 45 degrees (315 degrees), then rotate it vertically by 63.435 degrees (296.565 degrees).
The first rotation is simple enough, but if I then go to Local coordinates, and rotate the prim vertically, then all the rotations go haywire. The prim itself looks fine, but the axis i am rotating on does not show the 63.435 degrees I am looking for, and the axis I have not rotated on now has a value in it.
Does anyone know how to turn rotations in 2 axes into 3 axes values?
Many thanks for any advice here. I will cross post this in the scripting forum too, as this is applaciable to both scripting and building.