Wednesday, February 28, 2007

Pros and Cons

The brouhaha developing over the integrated voice chat is really interesting to me. I missed all the previous "ZOMG THIS IS THE END OF SL" changes — land fee changes, free accounts, and so forth — so this is my first experience with the wide spectrum of reactions.

Unlike some of the posters, I can see both sides of the argument. Speaking as an SL "educator", I think this will be a wonderful tool for teaching classes. I hate having to cut-and-paste due to the time constraints of disseminating large amounts of information in a fairly short time. If the students had to wait for me to type everything — and go back and correct typos, because I obsess about that — my hour-long classes would take at least a couple of hours each. Being able to actually speak it — and to let students actually ask their questions at speaking speed, instead of having to wait (sometimes interminably) for them to finish typing them, would be wonderful.

On the other hand, as I have a friend with profound hearing loss, and another with a bad speech impediment, I can understand the horror that some might feel at this development. My friend who stutters loves online forums because he can communicate as freely as everyone else; if he played Second Life, I can just imagine how this would affect him. And then of course there are the gender changers; this will pretty much spell the end of their SL identities.

I'm personally ambivalent about it; I really look forward to using it as a tool in teaching, but it'll make me feel really self-conscious because I hate the way I sound in recordings. (Why does it sound so different from the way I sound to myself when I'm speaking?) And I get stage-fright on conference calls. But maybe speaking more in SL will help me get over that. So I don't know. I'll have to wait and see.


And at the risk of sounding crabby, I'm getting really tired of the SL blog commenters who always complain about Linden Lab addressing anything but the commenters' pet-peeve bugs. "How can you waste time on X when you haven't fixed Y?" It's like saying "Why are you doctors and scientists trying to cure diabetes, blindness and Alzheimers when you haven't cured cancer yet?"

Monday, February 19, 2007

A Week's Work

Wow, has it already been a week since the last time I posted?

The head of Rockcliffe University, where I teach building (and am writing a scripting course, which hopefully will debut before the end of the month), went and bought an entire sim. Which means all new classrooms!

One thing which I thought the old space lacked was actual lecture halls. So I decided to build one . Once I got through the inevitable round of "could you change this and this and this?" (never build things "on spec" if you're trying to realize your own vision!), I ended up with this layout:



Sure, it'll get the job done, but it's not all that exciting visually. So I took a couple of days, and wrote the set of scripts I've been planning to write for ages.

One script, which I dropped into every prim in the build (except the chairs), just sat there until I uttered a command. Once I did, each prim announced all of its parameters: location, size, rotation, type, hollow, cuts, and so forth. I copied all that information out of my chat history and pasted it into a text file on my computer.

Then I ran that text file through a PHP script which I wrote to convert each prim's data into a POV-Ray object. POV-Ray is a freeware 3D renderer, which does shadows and other things very nicely. The great thing about it is that its scene description language uses plain text statements which describe graphics primitives very similar to what's used in Second Life: boxes, cylinders, spheres, tori, and so on! So my PHP script converted the build into a POV-Ray scene file, which (when rendered out) looked like this:


Not terribly exciting when everything's grey, so I started adding textures to everything. It's not really easy to add image textures to different surfaces of POV-Ray objects, like it is with Second Life prims, but POV-Ray has some very versatile texturing capabilities in its own right. After another day or so of writing texture statements, it rendered out like this:


I then rendered out orthographic views of pretty much every surface, which gave me image maps I could then upload and apply to the build in Second Life. This was what took the longest, as I had to calculate the repeats and offsets for pretty much every face. But in the end, I think it was worth it, as here's what the final result looks like in Second Life:



The chairs are kind of lame, unfortunately. I had made much better textures for them, with rounded backs and seats which appear to curve down in front, but they'll have to wait until the alpha-texture sorting bug is fixed before they make their appearance.

But regardless of textures, the chairs themselves are very low-prim; each bank of four chairs consists of seven prims, whereas the five-chair banks are only eight prims each. Through the judicious use of alpha textures, I was able to make them look more complex than they actually are. They don't stand up to close scrutiny, but they manage to seat 52 people at a cost of only 88 prims (the entire build is 186 prims).

And here's a view looking from the side of the stage out towards the back of the hall:


Oh, foo, I just noticed I forgot to make the doors more interesting, with a crash bar and a narrow pane of safety glass and one of those things up in the corner to make it close slowly.

And no emergency exits! I hope there aren't any fire code inspectors in Second Life!

Monday, February 12, 2007

Textures and Generators

In one of recent posts, Ged Larsen talks about wrapping a texture around a skirt built by his fantastic LoopRez script. He sums up his experiment by saying:

I don't think this script could ever be useful as a releasable tool, though. Essentially, I think for every project, the script would have to be re-coded, which would probably not be worth it.
Of course, to me that sounded like a challenge! I've been meaning to get back to my own necklace generator and finish up the features I want to have in it, so I pulled it out and started to work.

But the first thing I needed to do was make mine faster. Because calculating equal placement on the circumference of an ellipse is extremely complex math, which to be honest I don't understand well enough to translate into LSL. So I did it the ugly, lazy way.

In essence, I started from a particular point on the ellipse and gradually increased the angle, bit by bit, until the position represented by that angle was at the distance I wanted it to be, within a certain amount of tolerance. The lower the tolerance, the longer the process took. For tiny prim jewelry, that required a really low tolerance.

So I ripped out all that code and replaced it with something much faster, based on a binary search algorithm. Basically, it takes two angles: at first, the back of the necklace and the front of the necklace. Then it picks an angle halfway between the two. If the angle is too large, it then recalculates between the starting point and the halfway point and tests again. If the angle is too small, it recalculates between the ending point and the halfway point, repeating until it's gotten within a certain amount of tolerance from the position we actually want. Then it moves on to the next piece, using the previous piece's location as the starting point to calculate from, and so on until it reaches the front of the necklace. (The other side is just a mirror image of the first, which is trivial to calculate.)

It sounds like more work, but even with a narrow tolerance, it's at least four times faster than the old version with a wide tolerance.

As to the image wrapping: while I can place the image on the prims in the proper location, it doesn't quite look right with the usual tapered cylinders that dresses are made out of; the narrow tops have too much image on them, and the wide bottoms too little. That problem will take a little thinking about. Perhaps it won't be as noticeable with a fabric pattern as it is with a snapshot.

Ged asks to see what progress I've made on it; here's a snapshot showing two different "waist sizes", with the same texture wrapped around the "skirt":


(The image I used was a snapshot of me with my friend Rhetorica and some of her schoolmates.) The problem I mentioned above is more visible on the smaller "skirt", up at the top. There's no "poof" to them because I haven't put in code to do so yet.

The process required that I create a skirt panel and drop in a script, then put the panel into my generator's inventory. Then, for each panel, the generator calculated the placement, texture offset and texture repeat values. It then rezzed out all the panels, and then sent the texture information to the script in each one.

It still has quite a ways to go, and I think I'm going to fork off a skirt generator from my necklace generator, just to make the latter faster yet (the fewer calculations it has to do, the better for speed's sake).

Wednesday, February 7, 2007

Conundrum!

I noticed the other day that some of my scripts were able to execute on no-script land.

Through the process of elimination, I was able to narrow it down to exactly what combination of factors permitted this to occur, and now I can reproduce it at will — for example, I modified the "Sexy Walk" attachment so it now continues to function in no-script territory; no more monkey walk for me!

My first thought was, "I should probably report this as a bug."

My second thought was, "But I could make a mint selling AOs that keep working!"

My third thought was, "I wonder if this is an exploit. Do they still offer a bounty on exploits? And if I don't report it, but sell objects which make use of it, would I get banned?"

Further research is needed.

Tuesday, February 6, 2007

Nifty Find

Sometimes I'll just look around on the map to see what interesting-sounding sims are nearby. While doing benchmarks for the First Look viewer, I saw some interesting — but unfortunately inaccessible — sims with names like TextureTest, Bug Island, Island for Misfit Toys and Danger! Danger!

Looking to the west of First Look Isle, I saw a block of six sims with German names, one of which looked like it had a fort on a promontory of land.

I had to check it out — and I'm glad I did! Sitting atop a large hill, surrounded by a lush trees, was a haunting ruined castle, like one of King Ludwig the Mad's notorious projects fallen into disrepair.



As I walked upon the broken stones, avoiding the sporadic rubble, I espied some familiar objects. Glowing hands atop pedestals. A parrot. An eye-chart. In a courtyard at the bottom of the castle, a sign read Willkommen in der Orientierungs Burg, which even my pathetically rusty German could recognize: Welcome to Orientation Castle.


I've heard mention of a new Orientation Island; I wonder if this is what they will look like. It's certainly a lot more compact than the existing ones, taking up maybe a sixth of the sim. And the beach ball has been replaced with a well, into which (I think) the notecard says you're supposed to drop a large rock. There is a "physical" rock on a nearby staircase landing, but it's locked; I can't move it.

I've been looking around for a similarly upgraded Help Island, but so far haven't found one. There is a cluster of German-language, standard Orientation Islands just to the south of Frisch, though. I wonder how many other languages have their own Orientation Islands?

In sadder news, the Dynamic Reflections option has been removed from the Client->Rendering menu of the most recent First Look build. :( I can still enable it through the Client->Debug Settings dialog, but it crashes the viewer on my Windows machine immediately. (It still works on my Linux box, but that's not as powerful.)

It looks like most of the rendering improvements will be put into the official viewer soon! :) Get ready for smoother motion!

Friday, February 2, 2007

Oh. My. God.

I tried out the First Look viewer yesterday. I'd put it off, because in the comments about it in the official SL blog, I've read all sorts of wailing and gnashing of teeth about how unstable it is, but I was bored and wanted to see these "render pipeline improvements" for myself.

It was quite a bit faster (I haven't got exact numbers, but everything was much smoother), until I started playing around with the debug options and found the one to turn on reflections.

It's not just an image map of the sky sphere overlaid on the texture of shiny objects, the way the current "Shininess" texture setting works — my guess is that every so often (especially when you change position), the viewer renders a 360-degree panoramic image of your point of view, and then overlays that image onto shiny objects.

It's not perfect (for example, in order to see yourself in shiny objects, your point of view has to actually be in front of your avatar; and if you're in mouselook mode, you're either invisible or headless depending on whether or not you've got "Show Avatar in Mouselook" checked in your Graphics Preferences.

But still, it's phenomenal, and the frame rate with reflections turned on seems pretty comparable to the existing (non-First Look) viewer. And it didn't crash once while I was using it, though I noticed flexi prims aren't nearly as flexible as they are in the existing viewer, and HUDs tend to flicker madly from time to time.

While walking around and looking at reflective things, I took a trip to the Design Center in Idea City. It has some nifty tutorials on shadows (using a different technique than baking them right into your textures), and a nice display on microprims.

One thing that I hadn't managed to figure out with microprims was to make a complete sphere smaller than 0.01 in all dimensions. In my jewelry, I'd been faking it by stretching a sphere and then dimpling away all but the very tip, and using that as a mostly hemispherical bit, but it was far from perfect. The Design Center display gave some really good advice: use Hollow, and then apply a transparent texture to the outer skin of the sphere.

This was great, but the shadows are reversed in the hollow -- at noon, for example, the top of the microsphere would be shadowed while the bottom would be lit.

I found that by setting the twist on the sphere to -180 for both the begin and end, it will turn the shadows "right side up" and look much better.

And, oh, how tiny you can get them! In the image below, the moon on the left is 0.01 in all directions, the smallest SL will let you make it. To its right is another one, hollowed, twisted and textured, with the hollow set at 10 — a millimeter in diameter. And to its right, the dark grey dot, is one with the hollow set to 1, a tenth of a millimeter wide. It's almost too small; nobody would ever look closely enough to actually see it.



Now to make some jewelry with tiny little spherical gems!

Tuesday, January 23, 2007

The Lost Art of Communication

I was in an empty classroom, working on some visual aids for a class on texturing, when a shirtless, tattooed man walked in. The conversation was pretty bizarre.

Him: hi
Me: Hello.
Him: your the teacher?
Me: I am one of the teachers here at Rockcliffe, yes. :)
Him: make me a star

Now, I assumed that he was demanding that I produce for him a five-pointed star object. I have no problem helping people learn how to build objects, but being brusquely commanded to work for them, without even so much as a please, makes me ornery. So, with the old joke about "How do I get to Carnegie Hall?" leaping forth from my memory, I deliberately misinterpreted him.

Me: What instruments do you play?
Him: giuttar at real live
Me: Well, the first step would be to start playing at clubs which have "open mic nights" in order to get exposure.
Him: and than??
Me: Well, assuming people like what you play, you'll eventually gain a following, and perhaps become a star.
Him: i think you teach me?
Me: I'm afraid I'm not really the person to speak to about that; I'm not a musician and have no experience with performing in SL.
Me: All the "stars" I see in SL have basically performed until they've gained a following.

Well, I thought I'd been deliberately misinterpreting him! But I decided to make sure what he really meant.

Me: Or was that not the kind of star you were talking about?
Him: where can i find the crime lorde here??
Him: i mean mafia ORE SO
Me: I have no idea whom you might mean. This is a university, not a Mafia stronghold.
Him: (teleports away)

Huh?

Sunday, January 21, 2007

Open for Business

Johanna Hyacinth Designs is now open. I still haven't rerendered the textures to match the new positions, but I'll get around to it once I muster the enthusiasm. (I hate having to redo projects, and if I put off opening the store until I get around to it, I might never open!)

Alas, the parcel's landing zone makes it more difficult to find my store (my old store's location was great: walk up the ramp right in front of you, last store on the left).

So now there are two ways to get there:

  1. When you materialize, walk all the way to the end of the hall, fly out the door, turn left, fly until you come to a similar door on your left, fly in, and I'm the first store there on the far wall (and if you come in this way, alas, all you'll see is a whole wall full of blank vendors which I haven't filled up yet).
  2. When you materialize, turn around, walk out the door, turn right, walk until you come to a similar door on your right, walk all the way down the hall, and I'm the last store on the left. But at least coming from this direction, most of the vendors hung on the window actually have products for sale.
However, I did IM the proprietor of the mall, and she promises to move the landing point to a spot between the two hallway entrances, so hopefully soon it'll just be "go in the door on the left and all the way down the hallway, I'm the last shop on the left."

I guess I'm going to have to work like mad if I'm going to fill up all those vendors... I'd put my PDA up for sale (it appears when you start typing, and you hold it in one hand and tap on it with the other), but I made it for me, and I'm a lefty -- so you hold it in the right hand and tap with the left. Which, since the default "wear" location (and most animations that involve hand-held objects) is the right hand, means that any time you wear most objects (like mugs and glasses, weapons, walking sticks, etc.), the PDA gets detached and you have to wear it again once you drop or detach the other object. (Even in Second Life, the rest of the dextrocentric world tries to keep us down!) Maybe I'll make a righty version of the animation, and let the script choose which one to play depending on what hand it's held in...

Friday, January 19, 2007

I'm not dead yet!

Okay, so I suck at blogging, apparently.

Actually I've had to cut way down on my SL time, darn it. So, what's been going on in the past ten days?

  1. I had my store almost completely set up and ready to go, when the owner of the mall it was in decided to renovate. Now, the purpose was to increase traffic for those of us on the second floor, since people rarely went up there (which I certainly can't complain about), and she did let us keep our same relative positions (well, moving closer to the front might have been nice). But unfortunately, the proportions and features of the new location are different, so I have to re-render all my textures. Fooey!
  2. I've started teaching classes at Rockcliffe University. It's a fledgling school (it just started up at the beginning of this month), and so far the curriculum is limited, but I like the founder's ideas and I would like to see it succeed. Right now we have four building classes (with a fifth hopefully debuting this weekend), but instead of the follow-a-recipe-by-the-numbers, here's-what-to-do-but-not-why kind of class that I've taken too many of, we're teaching what all the options in the Edit Pane do, and why and how you would want to use them. I'm also working on a series of classes to teach scripting, which has me very excited. Hopefully, we can get that course started in February.
  3. I met Ged Larsen, who (like me) found the existing necklace generator scripts a little lacking, and set to work building a better mousetrap. And what a mousetrap he's built! Whereas mine is slow and ponderous, but gets there in the end, his is snappy and full of mouth-watering bells and whistles.
  4. I downloaded the Open-Source Second Life Viewer code, but alas! it won't compile on my beautiful new 64-bit machine. Let's see, I can spend even more time out of Second Life fixing the code so that it will compile on my system, or just wait until some other enterprising Linux user modifies the code for 64-bit. Hmm, what to do, what to do?
  5. Yesterday, I finally came up with an easy way to demonstrate how Texture Offsets work, just in time to teach my first class on texturing. I'll have to take some screenshots once I get off work and put up a post on the issue.
  6. I had an awesome idea for a script this morning, which hopefully I'll find the time to write this weekend.
Okay, so I haven't really accomplished much. I'm such a slacker!

Also, on a completely random tangent: why is it that, when I'm on a dance pad and someone wanders into the casino when all the dance pads are full, I'm the person whose dance pad they sit on in hopes of bumping off? Every single time! Maybe I should make a mean-looking avatar for when I'm dancing.

Tuesday, January 9, 2007

O Happy Day!

When I arrived at my vendor-booth-in-progress to make some additions, I noticed that there was a SPACE FOR RENT sign blocking the booth next to mine. Dare I hope that the genitalia merchant next to me will be gone?

(Not that I have anything against genitalia per se, mind you — it just kind of clashed with the jewelry I want to sell.)

Complete tangent: Among the last names that exist in SL are Hartnell, Cushing, Troughton, Pertwee, Baker, Davison, McCoy, McGann, Grant, Broadbent, Lumley, Eccleston and Tennant. But not Atkinson? How on Gallifrey could they have missed him?