Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

question how to Rotate an object

Kiefer Beckett
Confused
Join date: 22 Jun 2004
Posts: 106
02-06-2005 10:19
I'm sorry if this is a well covered question; even after searches an answer, I still have questions (and sorry about cross post too I posted in the wrong group earlier-ugh):

I want to rotate an object 1/4 of a turn. So I found this script below. The problem is that is rotates on the object around the center of the object. I want to rotate the object around the left side of the object. The documentation for llEuler2Rot didnt help me.


default
{
state_entry()
{
state closed;
}
}

state closed
{
touch_start(integer total_number)
{

rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,-PI/4>;);
rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state open;
}
}

state open
{
touch_start(integer num)
{

rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,PI/4>;);
rot = delta * rot;
llSetRot(rot);

llSleep(0.25);
rot = delta * rot;
llSetRot(rot);

state closed;
}
}

thnx
_____________________
A tired mind become a shape shifter
Everybody need a mood lifter
[Rush - Vital Signs]
Upshaw Underhill
Techno-Hobbit
Join date: 13 Mar 2003
Posts: 293
02-06-2005 12:07
Something like a door hinge probably? :)

1> put the script in a linked prim on the edge you to be the hinge.

2> use cut to make the cube of your door a tiny sliver and the middle be the edge

3> try this from the Scripting Library /15/f5/33104/1.html

L8r,
UU
Kiefer Beckett
Confused
Join date: 22 Jun 2004
Posts: 106
02-07-2005 05:18
From: Upshaw Underhill
Something like a door hinge probably? :)

L8r,
UU


Actualy, thats where I got my script from, a door on a hing.

In my case, I want to make book or magazine. When someone touches a page, it would "open" to the next page. Now, I realize that I would fake it by using the 2 prim method like a door hing. It just seems like a waste of prims.
_____________________
A tired mind become a shape shifter
Everybody need a mood lifter
[Rush - Vital Signs]
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
02-07-2005 05:28
From: Kiefer Beckett
Actualy, thats where I got my script from, a door on a hing.

In my case, I want to make book or magazine. When someone touches a page, it would "open" to the next page. Now, I realize that I would fake it by using the 2 prim method like a door hing. It just seems like a waste of prims.



You can't, unfortunatly, change the axis around which a prim rotates...

With two exceptions. Cylinders and Cubes both have some limited ability to do this, with a lot of tweaking the Cut or Dimple parameters.

Make a cube with a beginning cut of .375 and an end cut of .875. You will get a cube that rotates around one side.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
02-07-2005 18:46
For the pages of a book, you only need as many prim blocks as pages. You don't need a hinge. Use cuts set at B=0.125 & E=0.475 (i think these are the numbers). You may need to rotate and resize your prim pages, but after setting the cut, you can rotate the prim to see that the rotation axis is on the edge of the prim (actually, it's still in the center, but you've cut away exactly half of the prim.)
Kiefer Beckett
Confused
Join date: 22 Jun 2004
Posts: 106
02-09-2005 06:38
From: DoteDote Edison
For the pages of a book, you only need as many prim blocks as pages. You don't need a hinge. Use cuts set at B=0.125 & E=0.475 (i think these are the numbers). You may need to rotate and resize your prim pages, but after setting the cut, you can rotate the prim to see that the rotation axis is on the edge of the prim (actually, it's still in the center, but you've cut away exactly half of the prim.)



ah....light bulb goes off in head. thnx thats a great idea
_____________________
A tired mind become a shape shifter
Everybody need a mood lifter
[Rush - Vital Signs]