BenQ Mobile

javax.microedition.m3g
Class PolygonMode

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.PolygonMode

public class PolygonMode
extends Object3D

An Appearance component encapsulating polygon-level attributes. This includes settings related to back/front face culling, polygon winding, lighting computations, perspective correction, and shading.


Field Summary
static int CULL_BACK
          A parameter to setCulling, specifying that the back-facing side of a polygon is not to be drawn.
static int CULL_FRONT
          A parameter to setCulling, specifying that the front-facing side of a polygon is not to be drawn.
static int CULL_NONE
          A parameter to setCulling, specifying that both faces of a polygon are to be drawn.
static int SHADE_FLAT
          A parameter to setShading, specifying that flat shading is to be used.
static int SHADE_SMOOTH
          A parameter to setShading, specifying that smooth shading is to be used.
static int WINDING_CCW
          A parameter to setWinding, specifying that a polygon having its vertices in counter-clockwise order in screen space is to be considered front-facing.
static int WINDING_CW
          A parameter to setWinding, specifying that a polygon having its vertices in clockwise order in screen space is to be considered front-facing.
 
Constructor Summary
PolygonMode()
          Constructs a PolygonMode object with default values.
 
Method Summary
 int getCulling()
          Retrieves the current polygon culling mode.
 int getShading()
          Retrieves the current polygon shading mode.
 int getWinding()
          Retrieves the current polygon winding mode.
 boolean isTwoSidedLightingEnabled()
          Queries whether two-sided lighting is enabled.
 void setCulling(int mode)
          Sets the polygon culling mode.
 void setLocalCameraLightingEnable(boolean enable)
          Enables or disables local camera lighting.
 void setPerspectiveCorrectionEnable(boolean enable)
          Enables or disables perspective correction.
 void setShading(int mode)
          Sets the polygon shading mode.
 void setTwoSidedLightingEnable(boolean enable)
          Enables or disables two-sided lighting.
 void setWinding(int mode)
          Sets the polygon winding mode to clockwise or counter-clockwise.
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CULL_BACK

public static final int CULL_BACK
A parameter to setCulling, specifying that the back-facing side of a polygon is not to be drawn.

See Also:
Constant Field Values

CULL_FRONT

public static final int CULL_FRONT
A parameter to setCulling, specifying that the front-facing side of a polygon is not to be drawn.

See Also:
Constant Field Values

CULL_NONE

public static final int CULL_NONE
A parameter to setCulling, specifying that both faces of a polygon are to be drawn.

See Also:
Constant Field Values

SHADE_FLAT

public static final int SHADE_FLAT
A parameter to setShading, specifying that flat shading is to be used.

See Also:
Constant Field Values

SHADE_SMOOTH

public static final int SHADE_SMOOTH
A parameter to setShading, specifying that smooth shading is to be used.

See Also:
Constant Field Values

WINDING_CCW

public static final int WINDING_CCW
A parameter to setWinding, specifying that a polygon having its vertices in counter-clockwise order in screen space is to be considered front-facing.

See Also:
Constant Field Values

WINDING_CW

public static final int WINDING_CW
A parameter to setWinding, specifying that a polygon having its vertices in clockwise order in screen space is to be considered front-facing.

See Also:
Constant Field Values
Constructor Detail

PolygonMode

public PolygonMode()
Constructs a PolygonMode object with default values.

Method Detail

setCulling

public void setCulling(int mode)
Sets the polygon culling mode.


getCulling

public int getCulling()
Retrieves the current polygon culling mode.


setWinding

public void setWinding(int mode)
Sets the polygon winding mode to clockwise or counter-clockwise.


getWinding

public int getWinding()
Retrieves the current polygon winding mode.


setShading

public void setShading(int mode)
Sets the polygon shading mode.


getShading

public int getShading()
Retrieves the current polygon shading mode.


setTwoSidedLightingEnable

public void setTwoSidedLightingEnable(boolean enable)
Enables or disables two-sided lighting.


isTwoSidedLightingEnabled

public boolean isTwoSidedLightingEnabled()
Queries whether two-sided lighting is enabled.


setLocalCameraLightingEnable

public void setLocalCameraLightingEnable(boolean enable)
Enables or disables local camera lighting.


setPerspectiveCorrectionEnable

public void setPerspectiveCorrectionEnable(boolean enable)
Enables or disables perspective correction.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.