Bruce Bonham Posted December 14, 2011 Share Posted December 14, 2011 Hello! Thanks for trying to help.I'm making one of those card-matching Memory games, and I'm currently working on having the game manager rezzing the shuffled cards. It works perfectly with the root object oriented the way it was when I programmed it. In that situation I just do this: for(i = 0; i < llGetListLength(newList); ++i) { if((counter > 0) && (counter%4) == 0) { xPos += xIncrement; zPos = 1.0; } else zPos += zIncrement; llRezObject(llList2String(newList, i), llGetPos() + <0.0, xPos, zPos>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0); counter++; } And it gives me a beautiful 4x4 grid of cards. Properly Aligned RezzingHowever, when I rotate the game manager object to a new orientation, then the cards are rezzing in the same location they were based on the earlier coordinates:Improperly Aligned RezzingI bumbled about with getrot, getlocalrot, getlocalpos, but can't get anything to work. Primarily, because I believe that when you rotate then xPos+= xIncrement won't function... if you turn it around the opposite direction then it should probably have to be xPos-=xIncrement. At least that's what I think the ultimate problem is.My question to you guys is can you help me find a solution that will allow my users to rotate the game board, or will I simply need to distribute it as uneditable and force them to only use the stock orientation?Thanks again for reading, any and all suggestions and help would be appreciated. Link to comment Share on other sites More sharing options...
Camille Yorcliffe Posted December 14, 2011 Share Posted December 14, 2011 Bruce Bonham wrote: My question to you guys is can you help me find a solution that will allow my users to rotate the game board, or will I simply need to distribute it as uneditable and force them to only use the stock orientation? Sure, you're adding an offset to the current position.... just multiply that offset by the current rotation, like so: llRezObject(..., llGetPos() + <xOffset, yOffset, zOffset> * llGetRot(), ...); You probably also want to pass the result of llGetRot() for the new rotation as well. Link to comment Share on other sites More sharing options...
Bruce Bonham Posted December 14, 2011 Author Share Posted December 14, 2011 You're beautiful. Thank you so much. Link to comment Share on other sites More sharing options...
Dora Gustafson Posted December 14, 2011 Share Posted December 14, 2011 What Camille said! If you have trouble with the position and the object you are rezzing has more prims in it or is a sculpty, you may find that llRezAtRoot() does perform better than llRezObject() does. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now