Jump to content

Rotation of a physical object


Shanbo Baddingham
 Share

You are about to reply to a thread that has been inactive for 3882 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 comment
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 comment
Share on other sites

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

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
 Share

×
×
  • Create New...