Autodesk, Inc.
Creating Simple 3DS GeomeTrees
A Tips&Tricks document for use with 3D Studio


Processes discussed in this document:
*    Preparing the bitmaps
       a. creating the opacity map
*    Creating the material
*    Preparing the scene
     a. creating the model
     b. applying the material
     c. rendering the scene


Software used for this document:
     Animator Pro 1.3a
     3D Studio r3

Bitmap used for this document:
     LIRITUL3.TGA
     (refer to AutoVision CD-ROM -- Imagecel sub-directory)

Reference:
     Animator Pro Reference Manual
       Poco           pg.3-50
       Masks          pg.3-54
       Palettes       pg.4-7
 
     3D Studio Reference Manual
       Creating Materials    pg.9-7
       Lights/Spot           pg.7-154
       Shadow Control        pg.7-160








===============================================================
Date:     14Mar.94            Rev: Original

Title:    Creating Simple 3DS GeomeTrees

Keys:     3D Studio, 3DS, Animator Pro, Opacity, Tree,
          Texture

Product:  3D Studio      Source:   Product Support
Release:  3              Expires:  next release
Platform: Dos386         Audience: All users

Copyright:  None      Confidential:  No         Replaces:  None

See Also: List related reading materials here
===============================================================

Creating the Texture and Opacity maps:
The  sample file, LIRITUL3.TGA, displays a tree on  a  black
background.   The file needs to be loaded into Animator  Pro
and slightly modified.

Initialize  Animator  Pro.   When  the  HOME  menu  appears,
loading  LIRITUL3.TGA  must be done via  the  Poco  routine,
NUMPIC.

*** Note:
      Since  the file is a 24bit image it cannot  be  loaded
  from  the `Files' menu under the PIC pulldown.  A  message
  stating that the image needs to be converted first will be
  displayed.   NUMPIC  automatically performs  a  conversion
  process.

Go  to  the  POCO  pulldown menu and select `Numpic'.   Make
selection number; `2.  Load Pic as Flic'.  Specify the  name
of  the Targa file to load, `LIRITUL3.TGA'.  Finally specify
[Replace]  as  the loading option.  The image,  LIRITUL3.TGA
now  appears  on the screen with a brown border  around  it.
Move  the cursor to a black area near the tree and  hit  the
[F2]  key.   This  sets the black background  color  as  the
working  color.  Now pick the `Fill' tool and pick  anywhere
on the brown border.  The final development is the tree on a
completely black screen.  From the PIC pulldown menu, select
`Files' and then [Save] the image with the name, TREE-T.TGA.
The `-T' signifies `Texture' for this tutorial.

In  order to quickly create the opacity map, right click the
[Mask]  button  and select `3 Clip'.  Notice the  background
change to light gray and the tree becomes darker gray.  This
mask  needs  to  be inverted, so pick `4    Invert'.   Right
click again, select `1   Use', then `0   Exit Menu'.

*** Note:
      Opacity maps specify areas of opacity and transparency
  on  the  surface.  White pixels in a bitmap create  opaque
  areas while black pixels produce areas of full transparency.
  Pixels  ranging  in  intensity  between  white  and  black
  represent various percentages of transparency.

With  the  mask active, right click in the palette  area  to
enter the Palette menu.  Pick a white color swatch and  make
the  R, G, B sliders are at 255.  Exit the Palette menu  and
select the PIC pulldown menu.  Select `Apply Ink' and notice
the  area where the tree was becomes white.  Go to the Files
menu   and  save  this  image  as  `TREE-O.TGA'.   The  `-O'
signifies `Opacity' for this tutorial.

Creating the texture map and opacity map is now complete.


Creating Simple Trees with 3D Studio:
Verify Map Paths:
Upon  entering 3D Studio, make sure that there is a map path
set  that  is  directed to the location of the  two  bitmaps
created  in  the previous section of this tutorial.   Verify
the  map paths by going to the `Info/Configure' dialog,  and
click  on the [Map Paths] button.  If the directory  storing
the  two bitmaps is not present, [Add] a new path, or  shell
out  of  3D Studio, [F10] [Y], and copy the bitmaps  to  the
3DS3\MAPS subdirectory.

Creating the Tree Material:
Using  the  [F5]  key, shift to the Material Editor  module.
Activate  the Map Type, Texture 1, and assign the TREE-T.TGA
file  to  the  Map  description.   Activate  the  Map  Type,
Opacity,  and  assign  the  TREE-O.TGA  file  to   the   Map
description.  The Amount slider for both map settings should
be 100.

It  is also important to activate the [2-Sided] button.   If
this  is  not  done, the material will only display  if  the
camera  is  in front of the object to which the material  is
applied.   If the camera moves behind the object,  the  tree
will seem to disappear.

To  test  the  material,  click on the  Background:  Pattern
setting  and  then  render the sample.   The  sample  should
display the color background pattern with the tree.   Select
the  Material pulldown menu and `Put Material'.   This  will
save the material to the currently loaded library file after
prompting  for  a  new  material  name.  After  saving   the
material, hit the [F3] key to shift back to the 3D Editor.

*** Note:
     TREE TEST was used for this tutorial, but it would  be
  more  helpful in the future to use a more descriptive name
  such as the type of tree.

Creating the Geometry:
The  following  steps will walk through the construction  of
the  tree object and application of the material to the tree
object.   The easiest way to create the object  is  via  the
GRIDS.PXP file while working in the Front viewport.

Load  the  GRIDS.PXP.   The dialog  that  appears  displays'
settings  for Length, Width and Height.  This tutorial  only
makes  use  of  Width  and Height,  so  change  both  Length
settings  to zero.  Change the Width and Height settings  to
ten  and  the Grids settings for both to one.  Hit [OK]  and
specify a name for the object.  Zoom the extents of all  the
viewports.

Applying the Material to the Geometry:
From  the  side menu, enter Surface/Material.../Choose,  and
pick  the tree material.  Select Assign.../Object and  click
on  the  object.  Since the material includes  mapping,  the
material  also  requires mapping application.   Do  this  by
going to the Surface/Mapping.../Adjust... menu.  Select  the
Face  Align  option  and click on the object  in  the  Front
viewport.   The mapping icon shouldappear in the  center  of
the  object.   If  not, use the Find command  and  the  icon
should  appear  as just mentioned.  Scale  the  icon  so  it
matches  the  size  of the object and pick  the  Apply  Obj.
command.  Click on the object to apply the mapping.

Test Rendering the Scene:
Before  any rendering can be done, the scene needs  to  have
some  sort  of light source.  Add a spot light to the  scene
via  the  Lights/Spot.../Create menu.  In the top  viewport,
zoom  out  a few times and place the spot light in front  of
the  object.   Click the Left viewport and  move  the  light
source so it shines from approximately 45 degrees above  the
object.

*** Note:
      If  the  desired effect is to have the tree accurately
  cast the shadow of the tree, the [Cast Shadows] button for
  the spot light must be active AND the Shadow Controls must
  be set to [Ray Trace].  The Shadow Controls are accessed via
  Renderer/Setup.../Shadows.  If [Ray Trace] is not set, the
  physical geometry will cast the shadow.  See examples below.

Click  in the User viewport and select Renderer/Render  View
and hit the [Render] button.  The object will now render and
only the tree image will appear.

Final touches to add further realism:
Using  what  has been created so far is sometime enough  for
some people.  For more realism and depth to the scene, there
is one more modification that can be made.  Click in the Top
viewport   and   activate  the  Local  Axis  Icon.    Select
Modify/Object.../Rotate, hold down the [Shift] key and  pick
the  object.   Rotate  it 60 degrees.  Repeat  this  process
again  but  rotate  the object 120 degrees.   From  the  top
viewport,  there  should  be  a  shape  that  resembles   an
asterisk.  Now select Create/Object.../Attach and attach the
two copies to the original object.
