Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Relationship between tubes and cylinders

DrDoug Pennell
e-mail is for old people
Join date: 13 Mar 2007
Posts: 112
01-20-2008 09:04
Hello,

This post arises from another discussion on the forum but I thought it might be better to start a new thread with the correct subject.

I need to replace a whole bunch of existing cylinders with tubes. When I select the cylinder and change the object type to a tube, it is no longer in the correct size or orientation. The size is easy to fix - I simply swap the x and z sizes and it is the correct shape.

The orientation (rotation) is not as straight forward. I cannot figure out a consistent relationship among the x, y, and z axes between the two shapes. That is, what should I add (or subtract) from the cylinder axes to get the tube to line up in the same orientation?

Thanks,

Doug
Tegg Bode
FrootLoop Roo Overlord
Join date: 12 Jan 2007
Posts: 5,707
01-20-2008 09:21
I'm no expert, but would it be easier just to use the hole function on the cylinders to turn them into tubes? Or is there another difference between them?
Look for a function called Hole Size in the Object tab while editing. There is also Hole shape there too.
_____________________
Level 38 Builder [Roo Clan]

Free Waterside & Roadside Vehicle Rez Platform, Desire (88, 17, 107)

Avatars & Roadside Seaview shops and vendorspace for rent, $2.00/prim/week, Desire (175,48,107)
DrDoug Pennell
e-mail is for old people
Join date: 13 Mar 2007
Posts: 112
01-20-2008 09:26
From: Tegg Bode
I'm no expert, but would it be easier just to use the hole function on the cylindes to turn them into tubes?


Hi Tegg,

That won't turn them into tubes, just hollow cylinders :-). My cylinders are already hollow. The reason I want to switch is that tubes are much more resistant to LOD artifacts than cylinders.

Doug
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
It's much easier than you think. No math required at all.
01-20-2008 10:31
The reason tubes are "more resistant" is because they have more polygons in them, 3.5 times as many, in fact. A cylinder has just 192, while a tube has 672. Take a look at each in wireframe view (ctrl-shift-r), and it's pretty easy to see what's going on with them.

So keep in mind that every time you use a tube, you're causing 3.5 times the performance hit that you otherwise would be with a cylinder. If it's just one prim, you'll never notice the difference, of course. However, if you're talking about several thousand tubes vs. several thousand cylinders, then people using lower end hardware may notice a drop in FPS when looking at your tubes.

Anyway, the relationship between tubes and cylinders, axis-wise, is pretty straight forward. Tubes are part of the same "family" of prims as toruses and rings. Changing from torus or a ring to a tube requires no changes in orientation. But changing from a cybe, cylinder, sphere, or prism to a tube, torus, or ring requires a rotation of 90 degrees on the local Y axis. It's a very simple change.

However, finding the right numerical relationship is not always easy, since the numbers in the editor only show global rotation, not local rotation. Unless you're really good with math, it can be very difficult to know what numbers to plug in. So let's talk about how to do it very easily without any math at all. First, I want to talk for a second about how the two orientations actually work, and then I'll give you the simplest way to do the alignment. It's a lot easier than you think.

Note that the flat sides or poles of a tube are always in line with the local X axis, and that the top and bottom, are actually the curved parts. The latter is easy to see by shearing the top. Part of the round side moves, not either of the flat sides. The prims in this family have an East and West pole, not a North and South pole, wich is a little bit counter-intuitive if you haven't thought about it before. The flat sides or poles of a cylinder, cube, sphere, or prism, on the other hand, align with the local Z axis, which is what you're more used to.

Rather than actually doing the math, which can be complicated, it's far easier just to use the reference grid, and snap the objects into place. Do the following.

1. Select the cylinder you want to change to a tube. Shift-drag it any direction to leave a copy behind. Note, when you shift-drag, the original is what moves; the copy stays behind.

2. Make sure also that you've got Use Grid turned on in your editor, and that you've got your chat bar closed. With the original cylinder still selected, press shift-G. This changes the ruler mode to Reference, and sets the selected cylinder as the reference object. Notice all on-screen rulers and grids are now aligned with your cylinder's local values.

3. Now, select the copy of the cylinder, and change it to a tube. Note that the manipultor tool (the red, green, and blue arrow crosshairs) is still in line with the reference object. Hold ctrl to change the manipulator from Move mode to Rotate mode.

4. Now simply rotate the tube on the local Y axis (the green circle on the manipulator), and snap it to the East mark on the white on-screen protractor. The tube will now be perfectly aligned with the cylinder.

The above 4 steps sound like they take a lot longer than they actually do. In practice, it's a 2 second operation. If you really want to go slowly, you could drag it to maybe six seconds or so. Two seconds to shift-drag, One to press shift-G, one to select the copy, and two to snap-rotate the copy into place. Once you've gotten used to the process, you just do it on instinct, and it takes 2 seconds or less.

The reference grid is one of SL's most important tools. Learn to use it well, and it will save you countless hours of time on every single project you ever do.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
01-20-2008 21:02
/me cuts this to paste it into a notecard and thanks Chosen!
_____________________
.
:) To contact forum folks, join the inworld group "The Forum Cartel". New residents with questions about SL more than welcome! We has parties!

:) To contact forum scripters, join the inworld group "Scriptoratti" (thanks Void!). New scripter questions welcome!
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
01-21-2008 05:52
From: Nika Talaj
/me cuts this to paste it into a notecard and thanks Chosen!

Ditto!

You know, I have been building in SL for years, and have never gotten the reference grid to work consistently for me. Thank you, Chosen, for the clear explanation!
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
DrDoug Pennell
e-mail is for old people
Join date: 13 Mar 2007
Posts: 112
01-21-2008 06:50
Amazing!

I tried this last night. Works like a charm. You just saved me probably an entire day of trying to line up tubes.

Amazing.

From: Chosen Few
So keep in mind that every time you use a tube, you're causing 3.5 times the performance hit that you otherwise would be with a cylinder. If it's just one prim, you'll never notice the difference, of course. However, if you're talking about several thousand tubes vs. several thousand cylinders, then people using lower end hardware may notice a drop in FPS when looking at your tubes.

Each of my tubes is about 25 cylinders and 30 or so toruses (made with Lex Neva's pipemaker), and I have about 8 tubes in the build so hopefully that won't be too bad. I keep a lower end computer around for testing these sorts of things so I'll see how much of a performance hit I take.
From: Chosen Few
The reference grid is one of SL's most important tools. Learn to use it well, and it will save you countless hours of time on every single project you ever do.


I do need to spend more time learning to use the reference grid. Right after I master those pesky alpha layers :). (ducks, runs for cover).

As usual Chosen, you have gone above and beyond the expected.

Thanks a million.

Doug
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
01-21-2008 06:52
Yup, thanks for explaining how Reference works!

However, wouldn't it be just as easy to use Local and rotate it by control-dragging, and move the cursor outside the compass-rose-like circle so that it's snap-to-major-divisions? That's what I use to rotate things around their axes; do it all the time and it's easy as pie.