Saving Face!

November 21, 2009

Yes, that title is a horrible pun.  :)

I am going to ask that you bear with me.  As I write this, I am working through the structure of the script that I have to write.

I have been playing with the llGetPrimitiveParams() function, and I have created a script that will tell you pretty much everything *except* the Face flags.  Face, you see, is not a simple concept for LSL.  Check out the Face List and you will see just how interesting this can be!  I can’t start making scripts that will permit Blind/VI users (and possibly those with other disabilities that inhibit use of the client’s editing tools) to create and manipulate objects until I am able to describe those objects with some degree of accuracy.  Clarity is another matter: the learning curve on this stuff is going to be steep, and we are going to have to find good teachers for it!

So, before we can describe the object, we have to know how many faces there are, and which ones they are. This is going to involve a fairly high degree of Artificial Intelligence for an LSL script: it’s going to have to analyze the prim that it is inside of and infer some things about how it looks.  Remember that a prim can have just 1 face (an unmodified sphere or sculpted prim), and as many as 9 faces (a heavily modified box or tube).

  1. What type of Prim am I?  We’ve got 8 possibilities here.
  2. How many sides (faces) do I have?  llGetNumberOfSides()
  3. The following are in varying order and may or may not appear depending on the answer to #1
  4. Am I hollow?
  5. Is there a profile cut?
  6. If there is a profile cut, have one or more faces disappeared as a result? Which ones?
  7. If there a path cut?
  8. If there is a path cut, have one or more faces disappeared as a result? Which ones?
  9. Do I have dimples? (And do they make me look cute?)
  10. Is the circular path broken for some reason besides a path cut? (Several conditions can create this.)
  11. Now we should have all the faces in their proper order in a list, by name.

Then we go through by face number, pull the name we assigned to that face, and add whatever information the builder is looking for: texture, shininess, bumpiness, alpha, color, texgen, glow, or fullbright.

When looking at the object as a whole, it would probably be best to just put the information in a parallel list. That way if we wind up with a list where the values are all the same, we can just say “This applies to all sides.” when speaking of a parameter.  If everything is the same color value, there is no point in spamming the user with the same value for each face.

Figuring out how to present the information efficiently is a later challenge, though.  First I have to figure out how to get the information accurately and without *too* much script load.  Fun!

The good thing is, once I know how to get it all effectively, making a script to modify the parameters should be relatively easy.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.