Link Search Menu Expand Document

Class Navigate

About :

	A class to define the navigation mode of a scene
Class diagram of class of Navigate.

Functions

Function summury
__init__(self, canvas)  
node_center_and_size(self, node) Get the center of a node bounding box + the radius of the box (more…)
auto_scale(self, node=None, propagate=True) Move observer to make the 3D scene fit in his view point (more…)
node_scale(self, node, alpha=1.03) scale an object (more…)
node_pull_push(self, node, speed=0.03) translate an object along z axis of camera frame (more…)
node_rotate(self, node, n=(0, 0, 1), angle=4) Rotate a node around an axis in camera frame (more…)
scene_rotate(self, space, ax, ay) Global rotation of the every node from a given space (more…)
scene_pan(self, space, ax, ay)  
scene_push_pull(self, space, delta)  
scene_zoom(self, space, ay)  
camera_rotate(self, ax, ay)  
camera_rotate_focal(self, ax, ay)  
rotate(self, C, x, y, ax, ay) rotation around the line passing through C and normal to ax x + ay y (more…)
camera_pan(self, ax, ay)  
pan(self, E, F, xe, ye, fd, ax, ay) Camera translation when a pan is produced by a mouse (more…)
camera_zoom(self, ay)  
camera_push_pull(self, space, delta, xyzactive=(True, True, True))  
reset_clipping_planes(self, node) reset near and far to see the whole node in front of the eye (more…)

Methods desciption :

init

def __init__(self, canvas)

node_center_and_size

def node_center_and_size(self, node)

Get the center of a node bounding box + the radius of the box

  • → node : the checked node
  • ← xc,r where xc is a 3D point and r is the expected radius

auto_scale

def auto_scale(self, node=None, propagate=True)

Move observer to make the 3D scene fit in his view point

node_scale

def node_scale(self, node, alpha=1.03)

scale an object

  • → node : scaled node
  • → alpha : scaling factor

node_pull_push

def node_pull_push(self, node, speed=0.03)

translate an object along z axis of camera frame

  • → node : translated node
  • → speed : pourcentage of overall radius

node_rotate

def node_rotate(self, node, n=(0, 0, 1), angle=4)

Rotate a node around an axis in camera frame

  • → node rotated node
  • → n direction in the camera frame
  • → angle in degree

scene_rotate

def scene_rotate(self, space, ax, ay)

Global rotation of the every node from a given space

  • → space : rotated space
  • → ax,ay : direction and angle in x,y eye frame

scene_pan

def scene_pan(self, space, ax, ay)

scene_push_pull

def scene_push_pull(self, space, delta)

scene_zoom

def scene_zoom(self, space, ay)

camera_rotate

def camera_rotate(self, ax, ay)

camera_rotate_focal

def camera_rotate_focal(self, ax, ay)

rotate

def rotate(self, C, x, y, ax, ay)

rotation around the line passing through C and normal to ax x + ay y

  • → C 3D point : the focal point indeed
  • → x,y frame (rigth,up) of the eye observer
  • → ax,ay proportio of mouse move in x and y direction
  • ← rotation matrix

camera_pan

def camera_pan(self, ax, ay)

pan

def pan(self, E, F, xe, ye, fd, ax, ay)

Camera translation when a pan is produced by a mouse

  • → E : eye position
  • → F : focal position
  • → xe,ye frame (rigth,up) of the eye observer
  • → fd focaldistance
  • → ax,ay proportio of mouse move in x and y direction
  • ← eye,focal new eye and focal position

camera_zoom

def camera_zoom(self, ay)

camera_push_pull

def camera_push_pull(self, space, delta, xyzactive=(True, True, True))

reset_clipping_planes

def reset_clipping_planes(self, node)

reset near and far to see the whole node in front of the eye

  • → node the checked node