Bases: object
Set and get the function for calculating the particle color: definition of the function color, it take as args a particle_set obj. and the particle index (R,G,B,A) = cfun( pset , index )
Initialize opengl display lists (must be called after glutInit!)
enable or disable the trajectory
set or get the step for drawing the trajectory
get and set the vector color function
Bases: object
Draw the given vector fields.
Constructor:
Parameters: |
|
---|
Insert a new vector function,
fun : Vector filed function color_fun : Colors function key : [optional] a key used for distinguish the vector field time_dep : [True or False ] if True Is a time dependent filed
Bases: object
Class used for controlling the rotation of the scene via mouse or joystick, by generating the virtual trackball effect
Constructor
Arguments w_size size of the window
- Example:
Event On click:
( x , y ) = get_click_coords_on_window() trk.track_ball_mapping( [ x , y ] )Event On Move:
( x , y ) = get_current_coords_on_window() ( rot_axis , rot_angle ) = trk.on_move( [ x , y ] ) glRotatef( rot_angle , rot_axis[0] , rot_axis[1] , rot_axis[2] )
Given the axes ( x and y ) of the joystick; it returns the axis and the angle of rotation. Example:
( rot_axis , rot_angle ) = trk.on_joystick( [ x , y ] )
function to be called when the mouse is moved. argument requires the coordinates of the mouse pointer and it returns the axis of rotation and angle.
Function to be called after a click on the mouse or at beginnig of the rotation, it takes the current coordinates of the pointer.