AgeSprite

From Alcugs

Jump to: navigation, search

Note: Anything extracted from any Plasma Resource Files is property of Cyan Worlds, Inc. You may not use these assets without recieving written permission from Cyan Worlds, Inc.

Please read this Notice from Cyan about Age Creation before continuing.

Previous: Alpha-blending Textures Contents Next: Python Scripts

Contents

Adding Rotating Sprites to an Age

Rotating sprites are objects that are made to always face the camera. This can be very useful to make lamp glares, and have D'ni holographic effects (think Watcher's Pub imager or Ayoheek table).

To make an effective sprite, you need to configure very little to the plugin, but on the other hand you need to carefully position your mesh within its local space.

Building your sprite object

In making a sprite, it is normal to use a plane, on which your image rests. Other types of objects are possible, but not recommended.

First we begin by adding a plane mesh object: [space bar]->Add->Mesh->Plane

Now we have a plane object, name it to something appropriate.

Make sure that you put the origin viewer on "Local" Image:VFMLocalspace.png

Next, we are going to rotate the mesh withing the objects local space. Press [tab] to enter edit mode.

Now we need to rotate the mesh so that the planes normal is pointing in the Z axes Negative direction.
1. Press the "Draw Normals" button, and set "normals size" to a high value
2. Use the [numpad-1],[numpad-3] or [numpad-7] keys, to have a view of the XZ or the YZ plane.
3. Rotate the plane (select all by pressing [a] one or two times, and press [r]) by -90,180 or 90 degrees. You need to have the plane fit in the XY plane perfectly, and have it's normal face away from the Z axis.
It should look something like this:

Image:VFMRotation.png

This is because the plasma engine will rotate the object so that the Z axis always points away from you.

Now, lastly we will make the plane have a slight offset in the positive Z direction

4. Make your view as in the leftmost picture above.
5. Have all vertexes selected and press [g].
6. Press [z] twice, to have it move on the local Z axis only, and move it slightly towards the negative Z side.
It should look like this:

Image:VFMOffsetRotation.png

7. Press [tab] again to leave edit mode.
8. Rotate your object to have it standing. Make sure that the objects local Y axis points up.

Now you have successfully made the Sprite object

Setting the correct parameters for a sprite

Basic sprites

For basic sprites all that you have to do is add/change the string property "alctype" of the objects logic properties. Make it say "sprite"

Now your sprite is configured for basic use - a lamp glare to be exact. This means that your sprite will always fully point towards the camera, and swivel according to your camera's angle to it - creating a good lamp glare effect.

Advanced Sprites

To have different sprite settings, you need to add another string property. Name it "sprite_flags" it will contain a 32 bit hexadecimal value.

It should sorta look like this: Image:VFMProperties.png

Now, to discuss the most important settings:

In short, there are 4 "Modes" in which a sprite can behave:

Mode 1 - Swivel mode (default export mode)

In Swivel mode, the sprite always faces the camera fully.

Additionally, it will add a sort of "swivel" rotation along the local Z axis of the sprite.

This depends on your camera's angle towards the original origin of the sprite. If your angle on the XZ plane is 0 degrees (equal to the negative Z axis), it will be standing up (not rotation) If th angle is 90 or -90 degrees, the image will be rotated by the same amount. The images rotation varies non-linear though. At small camera angle changes near 0 degrees, the image will wildly rotate, but with relatively large camera angle changes around 90 degrees, the image will rotate pretty slowly. That's why I call it "swivel mode".

Swivel mode is very well suited for lamp glares!

Mode 2 - Normal mode

In Normal mode, the sprite always fully faces the camera, but will not rotate around the Z axis.

To be more precise, the Y-negative axis will always point at the bottom center of your screen. This is only apparent at very close distances though.

Mode 3 - Imager mode

In Imager mode, the sprite rotates along the Y axis only. The sprite will always face the camera, but it's Y axis will always point into the same direction.

This is the mode that is used with the Ayoheek table in the Neighbourhood, and with the imager in the Watcher's Pub (Rolep). It creates a nice holographic feel, while still visible from all angles.

Mode 4 - Strange mode

In Strange mode, the sprite will always fully face the camera.

Additionally there is a strange rotation around the sprites Z axis. The image will rotate once, for every time the camera makes a full turn around the sprite.

This is probably useful if you want a more linear Z-Rotation than you have in swivel mode.


sprite_flags overview

To select one of these modes, you need to set bits 3:0 of the sprite_flags property. Some basic flags are listed below while a complete set of flags for the bitwise field is located here.

sprite_flags
000000800 - Object has Bounding Box associated (not sure why it is necessary)
000000020 - Needs to be on ALWAYS if off, the VFM won't work
000000010 - Adds some kind of matrix transformation, no difference perceived to viewer as of yet
000000008 - Select mode 4 (Strange Mode)
000000004 - Select mode 3 (Imager Mode)
000000002 - Select mode 2 (Normal Mode)
000000001 - Select mode 1 (Swivel Mode)
Previous: Alpha-blending Textures Contents Next: Python Scripts
Personal tools