Donnerstag, 22. November 2012

PrimBox (GlassBox tutorial, part 2)

In this step we want investigate the face order of the system box (used by scripts) and orientation of textures shown on the faces (used by designers.)

This is because we need a visual replacement for a system box. This step requires no meshing, we simply rezz the system box and put this script inside:

default {
    state_entry() {
        llSetTexture("4dcd62fc-a155-9701-8742-290e3ddab1da", 0);
        llSetTexture("5b0feec6-c238-b0e5-7b28-f94df3912cc9", 1);
        llSetTexture("089fe7b6-a04b-366a-5a8c-3173cbd4ef25", 2);
        llSetTexture("47465ae9-0be7-4eff-8bc1-ea04f673558b", 3);
        llSetTexture("f9593b54-6544-2fe8-abdc-f994bfbec109", 4);
        llSetTexture("1b59fe97-06f9-ac11-9490-9f89ceac2880", 5);

The script assigns the face with LSL number 0 a texture showing the number 0, the face with number 1 a texture showing the number 1 and so on. The textures show also tiny numbers in background preventing to read the image upside-down (possible only by the number 0 actually.)

Now we simply have to look at the box from every side:

The result:

  • The faces 1 to 4 wrap the box around the z axis and have vertical texture orientation.
  • The faces 0, 1 and 5 wrap the box around the x axis and keep the vertical texture orientation when the box is rotated around the x axis.

This labels the face 1 (the negative y) to be special: If we look at this face and rotate the box around x or z axis, we see the texture vertically oriented. Hence we assume this face to be front and label others by left, right, back, top and bottom in respect of that.

Now we have all we need to make a meshed replacement for the system box.

Next part: MeshBox

Keine Kommentare:

Kommentar veröffentlichen