• Announcements

    • Xiola Linden

      The New Community Platform   03/21/2017

      We are still working on making adjustments and changes to the new platform. Thanks  to everyone who has been sending in feedback and filing any bugs you've encountered! 
Sign in to follow this  
Followers 0
Roadmap Writer

Aligning tiles

3 posts in this topic

I need some help with the so nasty orientation/rotation math of LSL :-)

The context is that i like to rez tiles aligning to a "master"-tile. The problem however is that i dont get it done.

The master tile has a scale of <0.5, 0.5, 0.1>. When I touch one of the low-height-sides, I can detect the normal vector of that side with llDetectedTouchNormal(0). At the moment of the touch, i like to have a new tile rezzed of the same scale, but perfectly aligned (glued, without linking) to the touched side of the master tile. 

As long as I dont use any rotation around the x- or y-axis i manage to get it done. Like to have it more full proof with the math so that rezzing a new tile in every position and rotation will be aligned making a plane from out the master tile.

aligned tiles

Thanks in advance for any mathematical + script help.

Roadmap Writer.

Share this post


Link to post
Share on other sites

The new tile obviously has the same rotation as the original.
It is 0.5 m away from the original in the direction given by llDetectedTouchNormal

so:

float tileSide = 0.5;vector newTilePosition = llGetPos()+tileSide*llDetectedTouchNormal( integer index );rotation newTileRotation = llGetRot();

 

1 person likes this

Share this post


Link to post
Share on other sites

Apparently I thought way too difficult.

Thanks for the solution, Dora, it works exactly as i was looking for!

Plane of tiles

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0