Thursday, October 25, 2012

The steps to "TRI" for nanos


To make a nano mesh with Mesh Studio, you can use this method to trick SL into thinking the mesh you want to nano is larger than it is in reality by using single or double triangles.  There are a few things to consider for nanos.  These three steps create a single "tri" (triangle) from a prim box.



  1. Create a box and color one face red (or other color).  Remember that when you create a box, the top and bottom of the box is what can be tapered, which is good because the next step is...
  2. Taper the top of the box on X or Y to the full extent (1.0).
  3. Now make all the faces 100% transparent except the red, triangular face.  Since fully transparent faces generate no mesh, you are now left with something that will give you a single triangle.  
You can use this for many things, but for today, we are using it to trick SL as mentioned above.  Here are some things to consider:
  • We can create a Prim Face material by coloring one or more faces with a texture or tint.
  • We can apply full transparency to this Prim Face material once the object is made mesh, if we so desire.
  • The smallest an object can scale to is 0.01 on any given axis.
So what if I have a sphere that I want to use as a pearl or a gem, as a simple example, and I want this to be smaller than 0.01?

Let's call this example sphere the target or target nano piece.

A single tri will tell SL the size of two axes for height and depth or height and width or width and depth.  If all you need to do is regulate two axes, then the tri is your solution.  Put the target prim, you want as the nano, at the center of the triangle (remember these prims don't have to be tiny to begin with since we can scale them down).


Center the target prim on the triangle?  Kinda hard to get centers without some math here, you know.  

Yeah, which is why I always work on grid so the centers of the objects I work with are on whole numbers (25 instead of 25.8738).  It's easier to subtract or add to a whole number (helps if the prims are not odd sizes, too).  This is the recommended way for all builders to work.  Makes life a whole lot easier.  Don't know how?  Watch this classic video by Torley Linden:


If you need to be able to scale on all three axes, then you can:
  1.  use a box with a double taper (1.0 on X and Y)
  2.  make all the faces transparent except one on the left and one on the right.  

  • The height of the tapered prim will give the Z height.  
  • The length of the red triangle base will give the Y length and 
  • the distance between the red triangles will give the X width (if the triangles happen to be on the opposing side than my example, it is not a problem; this is just explaining that the size all three axes are being described through this double-faced triangular setup).  
  • Centering the target prim on this setup is easier since you just use the XYZ position of the tapered box
  • If you need to be able to size more on one or two axes, increase the size of the tapered prim on height or width or length or a combination of any two.
  • While you would normally use the  Stretch both button on the Edit menu, you may want to experiment with it off if you need to affect one side of the target more than the other.  This means the target would be off-center within the tapered prim (can be done with the single tri as well).


Why go to all the trouble of making a tri or two when you could just use a box?
  • a full box is 6 sided.  Each side generates at least two tris.  This means 12 tris for a box.
  • if your nano is fully enclosed, you can't reach it to texture.  Making the box material alpha doesn't mean you can easily reach in to the inner nano'd piece.
  • a single tri can be used at any angle or rotation; even if you use two singles together, they are still independent of each other at the prim level.  The double taper that creates two tris, leaves an opening to your target nano (transparent faces prior to generation, don't create mesh), but remain interdependent to each other being part of a single box prim in the build stage.
  • if you are working with a comlex linkset for which you are doing the custom LoDs, the fewer tris in the lowest levels, the better, has been my experience, to keep down the LI.
  • keep in mind that anything I say to you in my blog has been from what I have learned and what has been my experience.  No hard and fast rules, just suggestions from what little I know.  :)
Once you have set up either the single or double tri with your target prim, make sure the target prim is the root.  As always, name your linksets and drop in the Object2JoinedMesh script.  In this case, I used just the Low LoD setting in the MS menu and used it for the top three LoD levels and dropped the last two zero.

The result:


Once uploaded, you can make the triangular faces alpha.  I used a single prim for the demonstration; you can place a full necklace or other linkset in place of the sphere used here.  For mesh, really, you nomally would be making linksets that may have to come down in size.  If you have an object that sizes well on all but one axis, the single tri is a good thing to use.


Want a gem-like cut to your sphere?



I used the Low LoD setting, on the MS menu, which produces fewer triangles on the sphere.  The one on the left, above, used a Crease Angle of 10.000 in the uploader window (see image below).  This sharpened the edges on the lower polygon sphere I called for in MS.  The sphere you see on the right side is the same sphere with the default crease angle of 75.

To enable Crease Angle, you must checkmark Generate Normals.
What is the Crease Angle?

There's a good wiki page on various ways of testing the functionality of Mesh and gives an overview of much of what you find in the uploader window.  It's an older page; you can tell because the Uploader window you see on the page is different than the one you open in your present viewer.  Still, it has some good info.

Under Crease Angle, we have the following:

The Crease Angle adjusts the smoothness of the model.
  • Change the Crease Angle to 0 or 1.
  • Hit Enter in the text entry box
  • Verify nearly every polygon on the face should be apparent. In this case there is no smoothing - the normal of the face is used at all vertices producing a faceted look with a crease or hard edge between faces.
  • Change the Crease Angle to 180
  • Verify that the model now has smooth shading, no creases.
  • Confirm the bounds for entry are 0.000 to 180.00. Entering a value higher or lower will default back to boundary. Ex. entering 5000 will default to 180.00. Entering -20 will default to 0.000.
  • Confirm non-numeric characters cannot be entered for crease angle.
  • Confirm entering a blank value uses the previous value entered.
  • Confirm setting values for this field works for large and small models


You can see the model in the preview window and use the same commands for move, rotate and scale as you do for your camera controls.  When you work with the Crease Angle, watch your object in the preview and you'll see how the angles sharpen or smooth as you change the numbers.  A box has six sides that are all 90 degrees.  So on a box a crease angle of 89 will sharpen all of them.  The sphere will need a decrease in angle depending on how many faces on it.

I hope you found this helpful.  Please leave comments or questions.

Happy Meshing!
~ele

No comments:

Post a Comment