Maryld Althouse Posted September 21, 2011 Share Posted September 21, 2011 Is there a simple way to declare WHERE to rotate from, if I want the rotation offset to an axis? Picture a shoebox, one edged taped, as if to provide a hinge. I want the linside of my lid hollow, with another prim (the top) over it, as it to surround something when the lid is closed. I'd rather not add too many prims (because I have more to add already). I just want to offset the y axis to an edge, without cutting my prim (which would force me to add more prims...) Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted September 21, 2011 Share Posted September 21, 2011 No, the centre of rotation is always the centre of the prim being rotated. If you aren't going to use cut or texture tricks (latter not applicable in your case probably) then the only option is rotate-and-move. however messy it looks. This just gets worse with any additional prims that have to be moved separately, even using llSetLinkPrimitiveParamsFast() Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 21, 2011 Share Posted September 21, 2011 Rotation is always relative to the center of the prim. You can't change that. What you can do is rotate your entire prim relative to a linked root prim. You'd do that by first getting its local rotation with llGetLinkPrimitiveParams([PRIM_ROT_LOCAL]) , then making any adjustment and using llSetLinkPrimitiveParamsFast([PRIM_ROT_LOCAL]) to set the new rotation. You can probably modify my script from the LSL Library to do it, with a little thought >>> http://community.secondlife.com/t5/LSL-Library/Simple-Hinge-Action/td-p/875331. As written, it's a sliding action, but you can rotate using the same approach. Link to comment Share on other sites More sharing options...
Void Singer Posted September 22, 2011 Share Posted September 22, 2011 assuming all parts must be linked: if the lid isn't a sculpt or mesh, theres no way to use the normal cut prim hinge trick for the shape you describe (and even then the lid must be specially made) if the lid is multiple parts, the closest you can get is multiple scripts, one for each moving part, and they will have to both move and rotate. the next best (and better practice) is llSetLinkPrimitiveParamsFast with the LINK_TARGET parameter. in either case there will be time when you see the pieces move independantly assuming the lid can be a separate linkest (such as a stationary box): a single move and rotate called on the root should work fine, although there are rare instance when you will see them happen separately even when called from the same function. on the downside, if the item is to be sold, it needs to be boxed, or to have one part rez the other when in place. Link to comment Share on other sites More sharing options...
Domitan Redenblack Posted September 24, 2011 Share Posted September 24, 2011 How about making the lid prim "cut" so that it shows two faces on one side. Make one of these faces your lid texture, and the other transparent. Then when you rotate it, it rotate around the "hinge" so that the visible face looks like a lid, and the transparent face sticks out the back unseen. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now