InWorldz

Where your Dreams are our Vision!

It is currently Thu Oct 19, 2017 10:20 am | All times are UTC - 6 hours
 Page 1 of 1 [ 7 posts ] 
Author Message
 Post subject: A rotation trick
PostPosted: Sat Dec 10, 2016 12:15 am 
User avatar

Joined: Mon Mar 09, 2015 7:14 am
Posts: 938
An OMG That S*** I Learned In School Really Does Have RL Applications Moment:

You guys making trains on tracks or anything that where something rotates around something else, there is no need to use two separate objects.

1) Put a sphere at the center and link it all with that sphere as root.
2) Drop in a rotate script and adjust speed.
The entire thing is rotating, right? All of it.
3) Use edit linked prims to put another rotate script with the same rotation vector into the track but reversed. I mean if the entire thing is going <0,0,1.5> make the track rotate <0,0,-1.5>. The track rotation now counteracts the entire object rotation and the track stands still.
(It works!)
(Track is a single prim)


"We have Clearance, Clarence".
"Roger, Roger".
"What's our vector, Victor"?
"I don't know but the vectors cancel each other and net movement is zero"!



_________________
Logan's Stuff And Junk http://tp2.me/LOGANSSTUFFANDJUNK
My Youtube Channel - https://www.youtube.com/channel/UC2I0Zb-io_DK1argPuo4RyA
Jesus loves you. Everybody else thinks you suck.
Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 12:45 am 
User avatar

Joined: Fri Jul 29, 2011 2:10 pm
Posts: 3989
Location: France
Neat trick :-)

For the ones who do not understant: the two rotations cancel each other.

For information, I can create YichTrains tracks in a full circle. Well, you can also put a track photography texture on a torus or tube prim...



_________________
Elfs are in virtual worlds to share a vision of a wonderful life :-)
Elven bards and storytellers
"Elf Dream" for Elf living
"Shedrupling University" science
YichTrains Elven Works Lysaer Gortax Robots
Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 1:14 am 
User avatar

Joined: Mon Mar 09, 2015 7:14 am
Posts: 938
Yichard wrote:
Neat trick :-)

For the ones who do not understant: the two rotations cancel each other.
.


Correct. The main rotation script tries to rotate the track at <0,0,1.5> relative to the world but the track is rotating at <0,0,-1.5> relative to the world so the track's rotation cancels the object's rotation. The track stays still and the rest of the object (the train cars) rotates.



_________________
Logan's Stuff And Junk http://tp2.me/LOGANSSTUFFANDJUNK
My Youtube Channel - https://www.youtube.com/channel/UC2I0Zb-io_DK1argPuo4RyA
Jesus loves you. Everybody else thinks you suck.
Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 2:26 pm 
User avatar

Joined: Wed Mar 09, 2011 1:08 pm
Posts: 778
Location: Canada
llSetLocalRot

http://wiki.secondlife.com/wiki/LlSetLocalRot


Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 4:46 pm 
User avatar

Joined: Mon Jun 14, 2010 3:08 am
Posts: 5759
Location: Wales
You can also use a rotating texture for some of these needs - see the spoked wheels on the Charrette at IDI, which are actually fixed objects with different alpha textures on each face, animated by llRotateTexture.



_________________
Ark
Good judgement comes from experience, experience comes from bad judgement
Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 7:30 pm 
User avatar

Joined: Tue Jun 14, 2011 7:47 am
Posts: 395
Location: UK
LoganStargazer wrote:
...You guys making trains on tracks or anything that where something rotates around something else, there is no need to use two separate objects.

1) Put a sphere at the center and link it all with that sphere as root.
2) Drop in a rotate script and adjust speed.
The entire thing is rotating, right? All of it.
3) Use edit linked prims to put another rotate script with the same rotation vector into the track but reversed. I mean if the entire thing is going <0,0,1.5> make the track rotate <0,0,-1.5>. The track rotation now counteracts the entire object rotation and the track stands still....

Not exactly. If the whole kit and caboodle is one linked object, circular track, train and central root sphere, then the whole thing, including the track, is rotating at whatever rate you set. The track is then set to rotate at the same speed in the opposite direction. Visually it may appear to be static but it is actually doing a fair bit of movement. The closest RL analogy is someone on a treadmill/running machine - they may appear to be standing still to an observer who is looking at them from the waist up but there is a lot of effort going into maintaining that appearance of being continuously in the same place.

The part that I didn't really get was why the track needed to be linked in the first place. Couldn't it just sit there like track normally would and have the train run around above it?



_________________

~ Christine ~

Offline
 Profile  
 
 Post subject: Re: A rotation trick
PostPosted: Sat Dec 10, 2016 10:03 pm 
User avatar

Joined: Mon Mar 09, 2015 7:14 am
Posts: 938
Christine Nyn wrote:
The part that I didn't really get was why the track needed to be linked in the first place. Couldn't it just sit there like track normally would and have the train run around above it?


This trick is so it doesn't have to be two pieces. One piece is easier to move, take and so on.

And yes I meant visually "stands still". The train and track are actually moving at <0,0,3> relative to each other.



_________________
Logan's Stuff And Junk http://tp2.me/LOGANSSTUFFANDJUNK
My Youtube Channel - https://www.youtube.com/channel/UC2I0Zb-io_DK1argPuo4RyA
Jesus loves you. Everybody else thinks you suck.
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Site Navigation