Creating Objects in ActiveWorlds

The objects in ActiveWorlds are either .rwx or .cob files which stand for RenderWare and TrueSpace files respectively.

Here are a couple of great tutorials that are available at:

http://www.tnlc.com/rw/termsframe.html
http://www.grovers.com/objects/rw2.html

For a quick reference:
Prototype
Surface tag
Ambience
Specularity
Diffusion
Lightsampling tag
Color tag
Geometrysampling tag
Opacity tag
Assigning faces
Scale tag
Translate tag
Rotate tag


RenderWare skeleton for basic objects:

#---Models out the wahoo--------------   Anything with a # in front of it is ignored
#---Mike Hollenbeck copyright 1999----   by the computer.  It is mainly used for
                                         notation within the program.

modelbegin    This is the opening tag. It tells the computer that a 
              RenderWare file follows.

protobegin bolt    This is the opening tag for a prototype. A prototype
                   is a piece of the object that will be used more than once within the object.
                   So if you were making a car you would make a proto of one wheel and then 
                   create an instance (explained below) four times and move each one to its 
                   proper location.

#----top surface---------------
vertex -3 -12.5 0        #1          All of the vertices must be plotted out
vertex -1 -8.5 0         #2          individually.  I found it easier to draw each object out 
vertex -2 -4.5 0         #3          on graph paper first in order to determine where
vertex 0 -1.5 0          #4          vertices go.  The coordinates are in the order of
vertex -1 1.5 0          #5          x-axis, y-axis, z-axis  just like in math class.
vertex 1 4.5 0           #6          
vertex 0 6.5 0           #7          It is EXTREMELY important to number each vertex because once
vertex 2 9.5 0           #8          all the vertices are plotted you have to assign faces that
vertex 2.5 13.5 0        #9          connect each one, so you need to be able to identify each one.
vertex 3 9.5 0           #10
vertex 2 6.5 0           #11         In this example the object that is created by this program
vertex 3 4.5 0           #12         is a lightning bolt surrounded by a box-like enclosure.  In
vertex 1 1.5 0           #13         order to keep all the different surfaces straight in my head
vertex 3 -1.5 0          #14         I divided the vertices into different planes.  This first
vertex 1 -4.5 0          #15         section is the top face of the bolt if the bolt was laid on
vertex 3 -8.5 0          #16         its side.
vertex 2 -12.5 0         #17

#----bottom surface-------------
vertex -3 -12.5 -.5        #18       This section is the same surface except it is the back side of
vertex -1 -8.5 -.5         #19       the bolt, as you can probably tell from the difference in the
vertex -2 -4.5 -.5         #20       z-coordinates.  This surface will be located one-half of a
vertex 0 -1.5 -.5          #21       coordinate behind the first section.
vertex -1 1.5 -.5          #22
vertex 1 4.5 -.5           #23       I want to make clear here that when I refer to surface in this
vertex 0 6.5 -.5           #24       part of the program I am conceptually connecting all the
vertex 2 9.5 -.5           #25       points in my head and visualizing how the finished surface
vertex 2.5 13.5 -.5        #26       should look.  This makes it easier to apply the surfaces later
vertex 3 9.5 -.5           #27       in the program.  It's not a bad idea to break the object up
vertex 2 6.5 -.5           #28       into pieces that you can positionally remember.
vertex 3 4.5 -.5           #29
vertex 1 1.5 -.5           #30
vertex 3 -1.5 -.5          #31
vertex 1 -4.5 -.5          #32
vertex 3 -8.5 -.5          #33
vertex 2 -12.5 -.5         #34
                                     Now that the vertices are plotted, you can move on to assigning
                                     faces that connect them.  
    surface .6 .3 0                  The surface tag assigns values to the way the surface will
                                     appear.  The values are in the order of: ambient, diffuse,
                                     specular.  These stand for the way that each of those types
                                     of light reflects off the surface.  For example, if you set
                                     the ambient value to 1 the object would be completely white
                                     on the side that the light source is on and completely black
                                     on the opposite side.  The settings that I used here work
                                     well in AW for pretty much everything, but experimenting
                                     can lead to better results in some situations.

    lightsampling vertex             Lightsampling is how the computer determines how each polygon
                                     is lit.  Lightsampling facet places a light source at the center
                                     of each polygon and lightsampling vertex places a lightsource
                                     at each vertex of the polygon.  The result is when facet is 
                                     used in more complex objects there is a visible line where
                                     faces meet.  When vertex is used these lines tend to not appear,
                                     creating a smoother rendering.

    color 1 0 0                      The color tag is fairly easy.  Obviously this assigns a color
                                     to the polygons that follow it.  The values are in the order
                                     of: red, green, blue.  It is a simple RGB scale that is made
                                     of values from 0 to 1.  If there is a specific color that you
                                     want to use, take its appropriate RGB value and divide it by
                                     256.

There are other tags that can go with surface, lightsampling, and color as well.  One that can be useful
is geometrysampling.  The different forms of this are geometrysampling pointcloud, wireframe, and solid. 
If the tag is not used anywhere in the program it defualts to solid.  Geometrysampling wireframe does what 
the name implies, the object appears as a wireframe.  Geometrysampling pointcloud only renders the vertices, 
creating a connect-the-dot effect.  
Another tag that I have used extensivly in AW is the opacity tag.  This tag is used to alter objects' 
transparency.  It is followed by only one value between 0 and 1.  For a glass-like object, .4555 is great.
There are a number of other tags that can be placed here as well but these are the ones that I find most 
useful for basic objects.  For more go to the provided links on the links page.

One other thing to remember about these tags is that they apply to everything after them untill they reach
another tag of the same kind.  So you can alternate the colors of polygons or have different sides of the 
object lit differently.  This can be very useful when creating objects for specific instances.

triangle 2 1 17                      The next step is to apply polygons to the vertices to create
triangle 16 2 17                     surfaces.
triangle 15 2 16
triangle 15 3 2                      There are three different types of faces that you
triangle 4 3 15                      can use: triangle, quad, and poly.  You must always
triangle 14 4 15                     connect at least three points, otherwise there would
triangle 13 4 14                     only be a line.  When the object is rendered triangles
triangle 13 5 4                      always render correctly but quads work fine in AW, so
triangle 6 5 13                      I recommend saving your sanity and using quads wherever
triangle 12 6 13                     possible.  You can also use polys, however, these don't
triangle 11 6 12                     always work, especially when you try to use more than
triangle 11 7 6                      five vertices at once.
triangle 10 8 11
triangle 9 8 10                      When assigning faces to vertices is easy but tedious.
triangle 8 7 11                      The easiest way to explain it is to give an example.
                                     
                                     So picture a face of a box, a simple square.  You would
triangle 18 19 34                    start at any vertex (or corner) and go COUNTER-CLOCKWISE
triangle 19 33 34                    around the square until you got to where you started.  So
triangle 32 33 19                    if the top left corner was the first vertex that you plotted
triangle 19 20 32                    the tag would look like this:
triangle 21 32 20                    
quad 1 2 3 4
triangle 21 31 32 This would only apply if you originally numbered in a counter- triangle 21 30 31 clockwise manner. If you numbered in a clockwise direction it triangle 21 22 30 would look like this: triangle 23 30 22
quad 1 4 3 2
triangle 23 29 30 The reason for numbering counter-clockwise is due to the fact triangle 23 28 29 that when you number that way the face that is assigned to those triangle 23 24 28 vertices will be facing out towards you. You see, each face triangle 25 28 24 only has one visible side. If you want a two sided face you triangle 25 27 28 need to assign two faces to the same vertices like this: triangle 25 26 27 quad 1 2 3 4 quad 4 3 2 1 quad 2 19 18 1 It is important to remember that faces are only one sided when quad 3 20 19 2 working in world because if you go inside an object that is larger quad 4 21 20 3 than your avatar you need to have faces on the inside as well, quad 5 22 21 4 otherwise the object will disappear when you are inside of it. quad 6 23 22 5 quad 7 24 23 6 The order that you list the vertices when assigning polys is quad 8 25 24 7 more or less arbitrary as long as they are in a counter- quad 9 26 25 8 clockwise order. The way that vertices are lighted when using quad 10 27 26 9 lightsampling vertex is affected by the order of the vertices, quad 11 28 27 10 but the effects are minimal. This is more of a personal quad 12 29 28 11 preference sort of thing. quad 13 30 29 12 quad 14 31 30 13 quad 15 32 31 14 quad 16 33 32 15 quad 17 34 33 16 quad 1 18 34 17 protoend This tag tells the computer that it has reached the end of the prototype. Now a prototype doesn't do anything until you tell the computer to make one. This is called a protoinstance which occurs later in the program. protobegin cage vertex -7.5 -1 .5 #1 vertex -7.5 -1 -.5 #2 vertex -7.5 -2 -.5 #3 vertex -7.5 -2 .5 #4 vertex 7.5 1 .5 #5 vertex 7.5 1 -.5 #6 vertex 7.5 2 -.5 #7 vertex 7.5 2 .5 #8 surface .6 .3 0 This is another prototype that I used for this object. You can lightsampling vertex have as many prototypes as you want in a RenderWare file. color .6 0 0 quad 1 2 3 4 quad 5 6 7 8 quad 8 1 4 5 quad 2 7 6 3 quad 7 2 1 8 quad 5 4 3 6 protoend clumpbegin The clumpbegin tag is essential to every RenderWare file. Once inside of this tag every vertex must be plotted and manipulated individually, whereas in prototypes you can essentially assign a large group of vertices to a name and manipulate them all at once. Everything that I put into the prototypes could go after this tag. I used the prototypes because it is easier to keep track of things that are being moved around. A completely stylistic thing. scale .1 .1 .1 The scale tag is very important. If your object is not scaled corectly then it will appear either too big or too small in AW. The scale is entirely dependant on the coordinants of the vertices. In this case the scale would be way too large for AW. It would probably need to be reduced to about .01 .01 .01 in order for it to be the right size in AW. protoinstance bolt Now the prototypes come into use. To create an instance of a translate 2 0 6 prototype, just type "protoinstance" followed by the name that rotate 1 0 0 180 you assigned to that prototype. This plots all the vertices and protoinstance cage assigns faces to them automatically. translate 0 0 12 The next tag that appears in this section is the translate tag. rotate 1 0 0 180 This tag is used to slide vertices around. So if you were to protoinstance cage visualize the vertex or group of vertices on a grid, the command rotate 0 1 0 90 translate 2 0 6 would move the group of vertices following it translate -6 0 6 2 units to the right and 6 units towards your point of view protoinstance cage on the z-axis. translate 0 0 -12 The other tag that appears in this section is the rotate tag. rotate 1 0 0 180 This tag is very similar to the translate tag. As you can protoinstance cage probably guess, it rotates groups of points. The values that follow it represent the x, y, and z axes and the fourth number is the number of degrees that you want to rotate the points. clumpend The clumpend and modelend tags tell the computer that it has reached the end of the program. modelend


Back to Index