Grover's Renderware Tutorial

Renderware Walk-Through: Transforms

Hello, I'm grover, a World Builder and a renderware designer. This portion of the Renderware Walk-Through will explain Transformations, including Translate, Rotate and Scale. It will also cover Prototyping and clumps.
This is the second in a growing series. There is also a
Starting page, introducing vertexes and polygons and a thorough Texturing Page, courtesy HenrikG.
Transforms
Until now, the objects you've been working with have gone:

MODELBEGIN
  CLUMPBEGIN
    vertexes
    stuff
    polygons
  CLUMPEND
MODELEND
Often, this isn't the best approach to do it though. Take as an example, the railroad trestle- it has five identical ties and two rails. You already know how to make a simple box (the woodgrain on the ties will be discussed later). Instead, you can use the PROTOTYPE function to make the tie once and copy it five times. Click here for the actual .rwx file

MODELBEGIN
  PROTOBEGIN Tie
    vertexes
    stuff
    polygons
  PROTOEND
  PROTOBEGIN Rail
    vertexes
    stuff
    polygons
  PROTOEND
  CLUMPBEGIN
    PROTOINSTANCE tie
    PROTOINSTANCE rail
  CLUMPEND
MODELEND
The Prototyping saves the first object in an easily repeatable Tie object. Likewise the Rail object. You'll notice the brown wooden box we made in Tie and the grey rectangle from Rail sitting and not quite looking like a railroad testle. This is because we haven't moved it yet! We need one more funcion, TRANSFORMBEGIN. (I'll omit the Protobegins, etc for simplicity and list only the Clump) Transforms come in three flavors: SCALE X Y Z, ROTATE X Y Z Angle, and TRANSLATE X Y Z
It's important to remember how the transforms work. Each time you enter a transform statement, it alters the transform matrix- it resizes, shifts and rotates the matrix which will be applied to every object created after.
  • SCALE X Y Z This alters the size of the object by multiplying the three numbers to each vertice. SCALE 1 1 1 would do nothing. SCALE 1 0.5 1 would make an object half as tall.
  • ROTATE X Y Z Angle This rotates the object around an axis. ROTATE 1 0 0 -90 would rotate an object 90° about the X-Axis of the object. pgup-pgdn basically perform a ROTATE 0 1 0 15 in alphaworld. NOTE: the railroad object was originally a railing. I altered the posts into ties and the wooden rails into steel rails. a ROTATE statement was needed to lie the fence down on it's side and look like a railroad trestle.
  • TRANSLATE X Y Z Shifts the object left, right, up or down without altering it's geometry. For most applications, this is the most used. TRANSLATE .1 0 0 moves an object 1m in the positive X direction.
    
    CLUMPBEGIN
      TRANSFORMBEGIN
        TRANSLATE 0 0 -0.05
        PROTOINSTANCE Rail
        TRANSLATE 0 0.10
        PROTOINSTANCE Rail
      TRANSFORMEND
      TRANSFORMBEGIN
        TRANSLATE -0.2 0 0
        PROTOINSTANCE Tie
        TRANSLATE  0.1 0 0
        PROTOINSTANCE Tie
        TRANSLATE  0.1 0 0
        PROTOINSTANCE Tie
        TRANSLATE  0.1 0 0
        PROTOINSTANCE Tie
        TRANSLATE  0.1 0 0
        PROTOINSTANCE Tie
      TRANSFORMEND
    CLUMPEND
    

    Important thoughts to remember:
  • Transforms affect each other and order does matter! Think it through before you decide to resize, rotate and translate pieces.
  • Most convertor programs output the transform matrix as a single TRANSFORM statement. This statement completely resets the transform matrix- statements afterwards will work, but before will be ignored. I'm still not sure how to convert to/from this
  • TRANSFORMBEGINWill often be nested- transforms in the base effect every subtransform, even the definitive TRANSFORM
  • The TAG statements in an avatar file are akin to ROTATE statements. Helpful to know when you're editing avatars. Don't confuse this with others, such as Picture TAGs though! They work completely different.

    Go back to Starting or Textures, courtesty HenrikG.
    This page is meant to be viewed through the Active Worlds Browser's MSIE window You are the person to load this page since July 30, 1997
    (Hopefully this counter will be more reliable than the graphical counters i was using...)
    Send Me Mail!

    Mandatory legal crap:
    This page and it's contents copyright(c)1995 stepehen j fehr
    Trade Marked items are the respective property of their owners, Alphaworld and it's graphics are property or Worlds Inc, and actually used with permission!
    Back to Grover's Timer Killer