com.motorola.iden.micro3d
Class Object3D

java.lang.Object
  |
  +--com.motorola.iden.micro3d.Object3D
Direct Known Subclasses:
Figure, Primitive

public abstract class Object3D
extends java.lang.Object

The Object3D class is an abstact superclass for all the 3D objects that can be rendered by the 3D engine.

MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© COPYRIGHT 2003-2004 MOTOROLA, Inc. All Rights Reserved.


Method Summary
 Layout3D getLayout()
          Returns the Layout3D used for rendering this Object3D, or null if no Layout3D has been associated with this Object3D.
 Texture getSphereTexture()
          Returns the Texture used for environmental texture mapping with this Object3D or null if no sphere texture has been associated with this Object3D.
 Texture getTexture()
          Returns the Texture used for rendering this Object3D, or null if no Texture has been set associated with this Object3D.
 void setLayout(Layout3D layout)
          Specifies a Layout3D to be used when rendering this Object3D.
 void setSphereTexture(Texture sphereTexture)
          Sets the specified parameter as a sphere texture for this Object3D.
 void setTexture(Texture texture)
          Associates a Texture with this Object3D.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLayout

public Layout3D getLayout()
Returns the Layout3D used for rendering this Object3D, or null if no Layout3D has been associated with this Object3D.

Returns:
the Layout3D used for rendering this Object3D.

setLayout

public void setLayout(Layout3D layout)
Specifies a Layout3D to be used when rendering this Object3D. The specified parameter can be null, but only Object3D objects with a Layout3D associated to them will be rendered.

Parameters:
layout - the Layout3D to use when rendering this Object3D.
See Also:
Layout3D

getSphereTexture

public Texture getSphereTexture()
Returns the Texture used for environmental texture mapping with this Object3D or null if no sphere texture has been associated with this Object3D.

Returns:
the sphere texture used for environmental mapping or null if no sphere texture has been associated with this Object3D.

setSphereTexture

public void setSphereTexture(Texture sphereTexture)
                      throws java.lang.IllegalArgumentException
Sets the specified parameter as a sphere texture for this Object3D. The sphere texture is used for environment mapping.

Setting the sphere texture will also enable the enivironment mapping. Once the sphere texture has been set, this Object3D will be rendered with the specified sphere map. The sphere texture can be set to null. This effectively disables environment mapping for this Object3D.

The environment mapping does not have any effect on certain primitives. For primitives, only the Triangle and Quadrangle support environment mapping. For all other primitives, invoking this method will not affect the final result. Also, not all figures support environment mapping. Only figures that are designed to support environmental mapping will be rendered with the specified sphere texture. All others will be unaffected.

Parameters:
sphereTexture - the Texture to use for environmental texture mapping.
Throws:
java.lang.IllegalArgumentException - if the Texture is not a sphere texture.
See Also:
Texture.isSphereTexture()

getTexture

public Texture getTexture()
Returns the Texture used for rendering this Object3D, or null if no Texture has been set associated with this Object3D.

Returns:
the Texture used for rendering this Object3D or null if no texture is associated with this Object3D.

setTexture

public void setTexture(Texture texture)
                throws java.lang.IllegalArgumentException
Associates a Texture with this Object3D. The specified texture will be used when the Object3D is rendered.

This method does not affect certain primitives. The point and line primitives cannot use textures, and therefore this method will not affect the rendering of those primitives.

If the specified parameter is null then this Object3D will be rendered without a texture. In case of primitives that support texture mapping (triangle and quadrangle), if the texture is set to null, then those primitives will be rendered with a solid color that has been set for that primitive with the setColor() method. The only exception to this is the point sprite which cannot be rendered without a texture. In the case of figures, depending on how the figure was created, the figure will be either rendered without the texture, or will not be rendered at all.

Parameters:
texture - the texture to use when rendering this Object3D.
Throws:
java.lang.IllegalArgumentException - if the texture is an environmental mapping texture.
See Also:
Texture.isSphereTexture()