BenQ Mobile

javax.microedition.m3g
Class Camera

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Transformable
          extended byjavax.microedition.m3g.Node
              extended byjavax.microedition.m3g.Camera

public class Camera
extends Node

A scene graph node that defines the position of the viewer in the scene and the projection from 3D to 2D. The camera is always facing towards the negative Z axis, (0 0 -1), in its local coordinate system. The camera can be positioned and oriented in the same way as any other Node; that is, using the node transformations of the camera node and its ancestors.


Field Summary
static int GENERIC
          Specifies a generic 4x4 projection matrix.
static int PARALLEL
          Specifies a parallel projection matrix.
static int PERSPECTIVE
          Specifies a perspective projection matrix.
 
Fields inherited from class javax.microedition.m3g.Node
NONE, ORIGIN, X_AXIS, Y_AXIS, Z_AXIS
 
Constructor Summary
Camera()
          Constructs a new Camera node with default values.
 
Method Summary
 int getProjection(float[] params)
          Gets the current projection parameters and type.
 int getProjection(Transform transform)
          Gets the current projection matrix and type.
 void setGeneric(Transform transform)
          Sets the given 4x4 transformation as the current projection matrix.
 void setParallel(float fovy, float aspectRatio, float near, float far)
          Constructs a parallel projection matrix and sets that as the current projection matrix.
 void setPerspective(float fovy, float aspectRatio, float near, float far)
          Constructs a perspective projection matrix and sets that as the current projection matrix.
 
Methods inherited from class javax.microedition.m3g.Node
align, getAlphaFactor, getParent, getScope, getTransformTo, isPickingEnabled, isRenderingEnabled, setAlignment, setAlphaFactor, setPickingEnable, setRenderingEnable, setScope
 
Methods inherited from class javax.microedition.m3g.Transformable
getCompositeTransform, getOrientation, getScale, getTransform, getTranslation, postRotate, preRotate, scale, setOrientation, setScale, setTransform, setTranslation, translate
 
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

GENERIC

public static final int GENERIC
Specifies a generic 4x4 projection matrix.

See Also:
Constant Field Values

PARALLEL

public static final int PARALLEL
Specifies a parallel projection matrix.

See Also:
Constant Field Values

PERSPECTIVE

public static final int PERSPECTIVE
Specifies a perspective projection matrix.

See Also:
Constant Field Values
Constructor Detail

Camera

public Camera()
Constructs a new Camera node with default values.

Method Detail

setParallel

public void setParallel(float fovy,
                        float aspectRatio,
                        float near,
                        float far)
Constructs a parallel projection matrix and sets that as the current projection matrix.


setPerspective

public void setPerspective(float fovy,
                           float aspectRatio,
                           float near,
                           float far)
Constructs a perspective projection matrix and sets that as the current projection matrix.


setGeneric

public void setGeneric(Transform transform)
Sets the given 4x4 transformation as the current projection matrix.


getProjection

public int getProjection(Transform transform)
Gets the current projection matrix and type.


getProjection

public int getProjection(float[] params)
Gets the current projection parameters and type.


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.