Camera3d


Module hilo/game/Camera3d Requires hilo/core/Class, hilo/util/util Source Camera3d.js
Camera3d is a pseudo-3d camera.

Properties

Property Defined
fv:Number
The distance of the fov(The distance between eyes and the Z plane,it determines the scale ratio of the 3d object).
Camera3d
fx:Number
The x position of the screen viewpoint(The distance between the screen viewpoint and the screen left top corner on the x axis).
Camera3d
fy:Number
The y position of the screen viewpoint(The distance between the screen viewpoint and the screen left top corner on the y axis).
Camera3d
rotationX:Number
The x rotation.
Camera3d
rotationY:Number
The y rotation.
Camera3d
rotationZ:Number
The z rotation.
Camera3d
stage:Object
The 3d object's container, it can be stage or container.It is required if you need to sort the 3d object by z axis.
Camera3d
x:Number
The x position.
Camera3d
y:Number
The y position.
Camera3d
z:Number
The z position.
Camera3d

Methods

Method Defined
Constructor
Camera3d
project(vector3D:object, view:View):Object
Project the 3d point to 2d point.
Camera3d
rotateX(angle:Number)
Rotate by the x axis.
Camera3d
rotateY(angle:Number)
Rotate by the y axis.
Camera3d
rotateZ(angle:Number)
Rotate by the z axis.
Camera3d
Sort by z axis.
Camera3d
tick()
Used for the ticker.
Camera3d
translate(x:Number, y:Number, z:Number)
Translate the camera,used for Zoomin/out feature.
Camera3d

Property Detail

fv:Number
The distance of the fov(The distance between eyes and the Z plane,it determines the scale ratio of the 3d object).
fx:Number
The x position of the screen viewpoint(The distance between the screen viewpoint and the screen left top corner on the x axis).
fy:Number
The y position of the screen viewpoint(The distance between the screen viewpoint and the screen left top corner on the y axis).
rotationX:Number
The x rotation.
rotationY:Number
The y rotation.
rotationZ:Number
The z rotation.
stage:Object
The 3d object's container, it can be stage or container.It is required if you need to sort the 3d object by z axis.
x:Number
The x position.
y:Number
The y position.
z:Number
The z position.

Constructor

Camera3d()

Method Detail

project(vector3D:object, view:View):Object
Project the 3d point to 2d point.
parameters
vector3D:object — The 3d position, it must have x, y and z properties.
view:View — The view related to the 3d position.It'll be auto translated by the 3d position.
return
Object — The 2d object include z and scale properties, e.g.:{x:x, y:y, z:z, scale}
rotateX(angle:Number)
Rotate by the x axis.
parameters
angle:Number — The rotate degree.
rotateY(angle:Number)
Rotate by the y axis.
parameters
angle:Number — The rotate degree.
rotateZ(angle:Number)
Rotate by the z axis.
parameters
angle:Number — The rotate degree.
sortZ()
Sort by z axis.
tick()
Used for the ticker.
translate(x:Number, y:Number, z:Number)
Translate the camera,used for Zoomin/out feature.
parameters
x:Number — The x position.
y:Number — The y position.
z:Number — The z position.