Hello Im making a object that needs to rez another object at a certain position relative to the object Rezing it, using the same rotation of the object who rez'd it, so that no matter which rotation the rezzing object is, it will correctly rez the 2nd object in the correct location.
The problem is... Here is the code I use....
rotation rotty;
rotty = llGetRot();
llRezObject("object2", llGetPos(), ZERO_VECTOR, rotty, 0);
This code Rez's the object in the correct rotation, but since its a large cone object, and the cone objects *center* is not located at the pointy part of the cone (like i need it to) it spawns it in the wrong spot. What I know I need to do, is.. crate a offset to the xyz position based on the rotation of the object spawnning it, so that.. when rez'd in any direction the rez'd object will be rez'd in the right spot. Im not very good at the whole "Quaternions" thing, so I need some help in creating a math *function* that will do this for me.
If this helps, I have *linked* the rezzed object to the object that rezzed it, but put it in the CORRECT position it needs to be rezzed in before linking.. manually..
so what ever math function I use, must hold true to these numbers below... the formula/function must make Object's xyz result in object2's xyz using the rot shown for each.
Object: xyz = <209.54430, 128.64497, 71.94125> rot = <0.35838, 0.00000, -0.00000, 0.93358>
Object2: xyz = <209.54430, 131.04245, 69.28536> rot = <0.35838, 0.00000, -0.00000, 0.93358>
Object: xyz = <210.14034, 129.32277, 71.94125> rot = <0.23695, 0.26887, 0.70045, 0.61720>
Object2: xyz = <207.76189, 129.02122, 69.28537> rot = <0.23695, 0.26887, 0.70045, 0.61720>
Object: xyz = <209.53857, 129.32277, 70.37775> rot = <-0.73898, -0.67241, -0.02622, 0.03308>
Object2: xyz = <209.56349, 129.02126, 73.94287> rot = <-0.73898, -0.67241, -0.02622, 0.03308>
Object: xyz = <210.13492, 128.66025, 70.90325> rot = <0.72125, 0.45272, 0.13829, 0.50569>
Object2: xyz = <207.78523, 130.82182, 72.51825> rot = <0.72125, 0.45272, 0.13829, 0.50569>
Object: xyz = <209.91782, 129.87544, 70.84396> rot = <0.25703, 0.83199, 0.48099, 0.10191>
Object2: xyz = <208.42792, 127.20109, 72.69588> rot = <0.25703, 0.83199, 0.48099, 0.10191>
Object: xyz = <210.33446, 128.82976, 71.51678> rot = <-0.52347, 0.33201, -0.77858, 0.09778>
Object2: xyz = <207.18483, 130.30989, 70.68571> rot = <-0.52347, 0.33201, -0.77858, 0.09778>
Object: xyz = <210.33446, 129.30046, 71.72417> rot = <0.47690, 0.20344, 0.82160, 0.23697>
Object2: xyz = <207.18478, 128.90953, 70.07239> rot = <0.47690, 0.20344, 0.82160, 0.23697>
Object: xyz = <208.94295, 129.30046, 70.64684> rot = <-0.89193, -0.26869, 0.32699, 0.15920>
Object2: xyz = <211.33772, 128.90953, 73.27625> rot = <-0.89193, -0.26869, 0.32699, 0.15920>
Also, if there is a obvious easier way of doing this, that I am un-aware of, please let me know!
thanks for any help anyone can provide!!