Public Member Functions | Properties

camera3d Class Reference

3D相机控制类,不需要初始化。
通过get_camera接口可以获取到某个层次场景的3D相机控制实例 More...

Inheritance diagram for camera3d:
obj3d

List of all members.

Public Member Functions

def show
def hide
def is_hide
def set_ortho
def set_perspect
def set_placement
def look_at
def set_direction
def yaw
 绕y轴旋转一定弧度.
def pitch
 绕x轴旋转一定弧度.
def roll
 绕z轴旋转一定弧度.

Properties

 scale = property(None, None)
 无效

Detailed Description

3D相机控制类,不需要初始化。
通过get_camera接口可以获取到某个层次场景的3D相机控制实例


Member Function Documentation

def show (   self )
无效。相机不需要此操作

Reimplemented from obj3d.

def hide (   self )
无效。相机不需要此操作

Reimplemented from obj3d.

def is_hide (   self )
无效。相机不需要此操作

Reimplemented from obj3d.

def set_ortho (   self,
  width,
  height,
  min_z,
  max_z 
)
设置正交相机

参数 :
        width	: float  视口宽度
        height	: float  视口高度
        min_z	: float  近裁平面的z值
        max_z	: float  远裁平面的z值
def set_perspect (   self,
  angle,
  min_z,
  max_z 
)
设置透视相机

参数 :
        angle	: float 竖直方向视角(角度)
        min_z	: float  近裁平面的z值
        max_z	: float  远裁平面的z值
def set_placement (   self,
  pos,
  forward,
  up 
)
设置相机位置和朝向
需要注意的是,为了保持和world2d的x/y正方向一致,所以相机已经绕x轴旋转180度,也就是up的值为math3d.vector(0, -1, 0)
        全3D模式下无上述问题。
参数 :
        pos		: math3d.vector 相机位置
        forward	: math3d.vector 相机前方向
        up		: math3d.vector 相机上方向
def look_at (   self,
  point 
)
设置相机朝向

参数 :
        point	: math3d.vector 3D世界中的某一点,相机会以此点对准到屏幕中心
def set_direction (   self,
  direction 
)
设置相机方向

参数 :
        direction	: math3d.vector 相机的方向
def yaw (   self,
  angle,
  space_type = SPACE_TYPE_LOCAL 
)

绕y轴旋转一定弧度.

Parameters:
angle: float 弧度
space_type: int 空间类型: iworld3d.SPACE_TYPE_WORLD = 1 世界空间 iworld3d.SPACE_TYPE_LOCAL = 2 局部空间
def pitch (   self,
  angle,
  space_type = SPACE_TYPE_LOCAL 
)

绕x轴旋转一定弧度.

Parameters:
angle: float 弧度
space_type: int 空间类型: iworld3d.SPACE_TYPE_WORLD = 1 世界空间 iworld3d.SPACE_TYPE_LOCAL = 2 局部空间
def roll (   self,
  angle,
  space_type = SPACE_TYPE_LOCAL 
)

绕z轴旋转一定弧度.

Parameters:
angle: float 弧度
space_type: int 空间类型: iworld3d.SPACE_TYPE_WORLD = 1 世界空间 iworld3d.SPACE_TYPE_LOCAL = 2 局部空间
 All Classes Namespaces Functions Variables Properties