Jump to content

Rotation of a physical object


You are about to reply to a thread that has been inactive for 2575 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

And if I wanted to point the X axis straight up, would that become

llSetLocalRot( llGetLocalRot() * llRotBetween( <1.0, 0.0,0.0> *llGetLocalRot(), <0.0, 0.0,1.0> ) );

And if I wanted to point the Z axis to the left, would that be

llSetLocalRot( llGetLocalRot() * llRotBetween( <0.0, 0.0,1.0> *llGetLocalRot(), <1.0, 0.0,0.0> ) );

Just trying to get the format down

Link to post
Share on other sites

I think the problem is that llSetRot and similar don't work on physical prims.

In this instance, the simplest method is to use llLookAt(), since that works with both physical and non-physical objects and points the Z axis (rather than the X axis, which is what most functions use) at the specified position.

So try something like:

integer toggle;default{	state_entry()	{		llSay(0, "Hello, Avatar!");	}	touch_start(integer total_number)	{		toggle=!toggle;		if(toggle){			llLookAt(llGetPos()+<0.0,0.0,1.0>,1.0,0.1); // look at a point 1 metre above me		}		else{			llStopLookAt(); // turn the lookat off		}	}}

 

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 2575 days.

Please take a moment to consider if this thread is worth bumping.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...