13
| SPRITES
SPRITES
are special types of blocks that don't really have a 3D model, but that
offer particular behaviors to 2D images in 3D space. There are 4 types
of SPRITES:
SPRITE Blocks
The SPRITE Block "1"
The simplest SPRITE Block is simply a single plane on which you can place
a texture and which doesn't really have any behavior at all.
The SPRITEREVOLVE
Block "2"
The SPRITEREVOLVE Block is a single plane that spins around on its central
axis.
The SPRITEFACE
Block "3"
The SPRITEFACE Block is a single plane that always faces the viewer. No
matter what direction you approach the SPRITEFACE block from, the image
that is assigned to it will appear to be facing you.
The SPRITEFACET
Block "4"
The SPRITEFACET Block will unwrap a gif animation and present each frame
to be viewed from a different angle in the spot. For example, if you took
photographs of your favorite comfy chair from 8 different vantage points,
all in the same horizontal plane, then put those images together in a
gif animation, the SPRITEFACET block would unwrap that animation, making
it appear as if the chair were in your spot, and you could walk all the
way around it. Unfortunately, however, you wouldn't be able to sit in
this comfy chair. It would exist only to taunt you inside your spot, looking
all inviting and comfortable, yet forever unable to provide what it promises.
Virtual space guideline #421: "Comfy chairs are best left in the physical
world."
Sprite Parameters
There are 5 parameters that are associated with sprites. All sprites can
take the ALIGN, SOLID, and SIZE parameters. ALIGN specifies at what height
in the blockspace the sprite will appear. Sprites will appear at the bottom
of the block space by default. They can also be assigned to the top or
the center. SOLID determines whether or not you can walk through the sprite.
If SOLID="no", then a visitor can walk right through the sprite. If SOLID="yes",
then the sprite will be solid. SOLID="yes" by default. SIZE of course
determines how large the sprite will be. SIZE is measured in pixels and
cannot exceed "(256,256)". If no SIZE is specified, the sprite will be
the same size as the image that is placed on it.
The SPRITE Block can
also take an ANGLE parameter, specifying what angle the sprite is facing.
The ANGLE is expressed as whole number degrees from 0 to 359. The default
value is "0". The SPRITEREVOLVE Block can take a SPEED Parameter, expressed
as revolutions per second. The default value is ".5". Now lets take a
look at these Sprites in action.
Experiment
with Sprites.
Put the following <CREATE> Tags in your firstspot.3dml:
<CREATE SYMBOL="1" BLOCK="sprite">
<PART NAME="*" TEXTURE="images/animate.gif"/>
<PARAM ANGLE="45" SOLID="no"/>
</CREATE>
<CREATE SYMBOL="2" BLOCK="spriterevolve">
<PART NAME="*" TEXTURE="images/animate.gif"/>
<PARAM SPEED="1" SOLID="no"/>
</CREATE>
<CREATE SYMBOL="3" BLOCK="spriteface">
<PART NAME="*" TEXTURE="images/animate.gif"/>
<PARAM ALIGN="top" />
</CREATE>
<CREATE SYMBOL="4" BLOCK="spritefacet">
<PART NAME="*" TEXTURE="images/animate.gif"/>
<PARAM ALIGN="center" />
</CREATE>
And
change the map to look like this:
<LEVEL NUMBER="1">
###.@.###
#.......#
#.1.....#
#.....2.#
#.......#
#.3.....#
#....4..#
#.......#
#########
</LEVEL>
Save the file and open it in your browser. Walk around each of the different
sprites to see how they behave. Try walking right through them.
|