qgl.scene
index
/home/simon/svn/qgl/trunk/qgl/scene.py

This module contains all possible scene nodes and leaves.

 
Modules
       
Numeric
qgl
qgl.texture
weakref

 
Classes
       
__builtin__.object
Leaf
Node
OrthoViewport
PerspectiveViewport
Root
Switch
Transform
Group
Static
World
state

 
class Group(Transform)
    Group node is the node which contains renderable items.
It is a subclass of Tranform, and can therefore be moved and scaled in 
the same way as a Transform Node. Additionally, Leaf nodes can be added
to a Group, which will allow the leaves to be rendered. Only Group Nodes 
can contain Leaf Nodes.
 
 
Method resolution order:
Group
Transform
Node
__builtin__.object

Methods defined here:
__init__(self, *args)
add(self, *args)
Add a Leaf or Branch to the Node.
remove(self, *args)
Remove a Leaf or Branch from the Node.

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class Leaf(__builtin__.object)
     Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Leaf' objects>
list of weak references to the object (if defined)

 
class Node(__builtin__.object)
     Methods defined here:
__getitem__(self, i)
__init__(self, *args)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class OrthoViewport(Node)
    The Viewport specifies an area of the screen which all children are 
rendered to in an Orthographic projection.
 
.screen_dimensions are the physical screen coordinates which the viewport
will render to.
 
.size is the width and height of the screen coordinate system. This is 
usually the same as the screen resolution, but does not need to be.
 
 
Method resolution order:
OrthoViewport
Node
__builtin__.object

Methods defined here:
__init__(self, *args)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class PerspectiveViewport(Node)
    The Viewport specifies an area of the screen which all children are 
rendered to.
 
.screen_dimensions are the physical screen coordinates which the viewport
will render to.
 
.aspect is the aspect ratio of the screen.
 
 
Method resolution order:
PerspectiveViewport
Node
__builtin__.object

Methods defined here:
__init__(self, *args)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class Root(Node)
    The root node. There must only be one.
 
 
Method resolution order:
Root
Node
__builtin__.object

Methods defined here:
__init__(self, *args)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class Static(Group)
    Static node is a group which cannot be changed after it has been 
compiled. Any changes to leaf nodes or children won't work until the node 
is recompiled. The node however, can still be translated, rotates and 
scaled (relative to it's orginal values).
 
 
Method resolution order:
Static
Group
Transform
Node
__builtin__.object

Methods defined here:
__init__(self, *args)

Methods inherited from Group:
add(self, *args)
Add a Leaf or Branch to the Node.
remove(self, *args)
Remove a Leaf or Branch from the Node.

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class Switch(Node)
    Switch node has named groups of children and can change the traversal 
path depending on the active name. The initial name is 'default'.
To add children to a node, switch to the name, then add children as 
normal.
 
 
Method resolution order:
Switch
Node
__builtin__.object

Methods defined here:
__init__(self, *args)
switch(self, name)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class Transform(Node)
    Transform node is used to scale, move and rotate its child nodes.
 
.scale is the x,y,z scaling factor.
 
.axis is axis which the Node will rotate around
 
.angle is the rotation around the axis, specified in degrees
 
.translate is the x,y,z translation (movement or position) of the Node.
 
 
Method resolution order:
Transform
Node
__builtin__.object

Methods defined here:
__init__(self, *args)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class World(Node)
    The World node is a helper node which contains pre configured planes for
sky, ground, background and foreground.
 
 
Method resolution order:
World
Node
__builtin__.object

Methods defined here:
__init__(self)

Methods inherited from Node:
__getitem__(self, i)
accept(self, visitor)
add(self, *args)
clone(self)
disable(self)
disabled_accept(self, visitor)
enable(self)
remove(self, *args)
update(self, **kw)

Data and other attributes inherited from Node:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Node' objects>
list of weak references to the object (if defined)

 
class state
     Data and other attributes defined here:
Color = <class 'qgl.scene.Color'>
The Color leaf sets the color (including alpha value) for a nodes 
children and leaves.
 
.rgba is a 4 tuple sepcifying red, green, blue and alpha values.
DepthTest = <class 'qgl.scene.DepthTest'>
This leaf can disable and enable depth testing.
Fog = <class 'qgl.scene.Fog'>
The Fog leaf applies a simple GL fogging effect.
 
.start is z depth where fogging will start to be applied
 
.end is the z depth where fogging will end. Everything after this depth 
will be completely fogged out
 
.density is the fog density
 
.color is an rgba tuple which specified the fog color
Light = <class 'qgl.scene.Light'>
A light leaf will apply lighting parameters to all children rendered after it.
 
.ambient an rgba tuple which specifies the ambient light color
 
.diffuse an rgba tuple which specifies the diffuse light color
 
.specular an rgba tuple which specifies the specular light color
 
.position is an a x,y,z tuple which specifies the light position
Material = <class 'qgl.scene.Material'>
The Material leaf sets the Material value for a node's children and leaves.
Materials are important if you are using lights.
 
Diffuse reflectance plays the most important part in determining what colour
you perceive the object as and does not vary according to the position of 
the camera.
 
Ambient reflection affects the overall colour of the object and is most 
obvious when it receives no direct illumination.  For real world objects, 
diffuse and ambient are usually the same.
 
Specular reflection is the colour produced in hilights, and depends on the
location of the viewpoint.
 
Emissive colour implies that the material is a light source, but does not 
actually emit light on the scene.
 
Please see Chapter 5 of the Red Book.
Mesh = <class 'qgl.scene.Mesh'>
The Mesh leaf loads 3D model files. Currently, only .obj files are 
supported.
 
.filename is the filename of the obj file to load.
ParticleEmitter = <class 'qgl.scene.ParticleEmitter'>
A particle emitter shoots particles.
Polyline = <class 'qgl.scene.Polyline'>
The Polyline leaf draws a series of connected lines.
 
.vertices is a list of 3 tuples which are the points the line will be 
drawn through.
Quad = <class 'qgl.scene.Quad'>
The Quad leaf draws a rectangle using the current texture and color. It 
is drawn from its centre point.
 
.vertices are the vertices of the quad (automatically created from the 
w,h args.
 
.texture_coords is a 4 tuple of 2 tupels, which specifit the texture 
coords of the Quad
QuadList = <class 'qgl.scene.QuadList'>
Sequence = <class 'qgl.scene.Sequence'>
The sequence leaf draws an image sequence loaded from a file created
using the make_animation tool.
 
The (w,h) args specify the width and height of the animation. The 
filename arg specifies the filename which the sequence is loaded from.
To create create a sequence, see the qgl.tools module.
 
.frame is an index into the sequence which controls the currently 
displayed frame.
Sphere = <class 'qgl.scene.Sphere'>
The Sphere leaf draws a texture mapped sphere.
 
.radius is the radius of the sphere
 
.x_segments and .y_segments control the number of facets used to
approximate the sphere
Text = <class 'qgl.scene.Text'>
The Text leaf draws text using a specified font from the bottom left 
corner.
 
.text is the text string to be rendered
 
.font is the font filename used to render the text
 
.foreground and .background are rgba tuples which control rendering 
colors. If background is None, the background is transparent.
 
.size is the size of the text.
Texture = <class 'qgl.scene.Texture'>
A Texture leaf is added to a group node to change the texture which is 
used to render subsequent quads.
 
.filename is the filename to load the texture from
 
.filter is a bool which controls filtering
 
.mipmap is a bool which controls mipmapping