|
Zena Juran
Registered User
Join date: 21 Jul 2007
Posts: 473
|
01-08-2008 08:56
HIyas everybody, I have a rectangular sculpted prim (water) that I rez from inside a linked set (pool). If I move the linked set in any of the cardinal point directions, the water rezzes right in place. But If I rotate the pool on the z axis, the prim rezzes in all sorts of weird angles. Can someone help me out with stabilizing this so it rezzes in the proper place no matter the position or rotation of the pool? I don't plan on relinking, I want to keep the water as a phantom. This is what I'm starting out with: llRezObject(("Water"  ,(llGetPos()+<0,0,0.456>  ,<0,0,0>,llGetRot()*llEuler2Rot(<90, 180, 90>*DEG_TO_RAD),0); The root of the pool is a box with a rot of <0,0,0>. The rezzed prim has a rot of <270,0,0>. All help will be greatly appreciated! 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-08-2008 09:22
Try reversing the sense of the quaternion multiplication. That is, use llEuler2Rot(...)*llGetRot() To understand what a series of rotations is doing, think of a vector in the local reference frame (e.g. the object you are rezzing). Each rotation, from left to right, operates on it in turn to finally give the vector in the global reference frame (world coordinates). So if the rezzed object has a rotation of <270, 0, 0> relative to the pool, you'll want to apply that rotation (call it "water-to-pool"  before then transforming from pool coordinates to global coordinates (call that "pool-to-global"  . So the complete operation would be to take a vector in the water object's coordinates (e.g. the local x-axis) and apply the transformations as follows: <1, 0, 0> * water-to-pool * pool-to-global => waterXAxisInGlobalCoords Hope that helps with your implementation, and helps you think about rotational problems in SL in general too.
|
|
Zena Juran
Registered User
Join date: 21 Jul 2007
Posts: 473
|
01-08-2008 09:45
Thanks Hewee, That makes perfect sense! Thanks for your help, I appreciate it! 
|