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

This module contains all possible scene nodes and leaves.

 
Modules
       
Numeric
qgl
random
qgl.texture
weakref

 
Classes
       
__builtin__.object
Leaf
Color
Fog
Light
Mesh
Polyline
Quad
QuadList
Sequence
Sphere
Text
Texture
Node
OrthoViewport
PerspectiveViewport
Root
Switch
Transform
Group
World

 
class Color(Leaf)
    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.
 
 
Method resolution order:
Color
Leaf
__builtin__.object

Methods defined here:
__init__(self, rgba=(1.0, 1.0, 1.0, 1.0))

Data and other attributes inherited from Leaf:
__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 Fog(Leaf)
    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
 
 
Method resolution order:
Fog
Leaf
__builtin__.object

Methods defined here:
__init__(self, start=10, end=60, density=0.80000000000000004, color=(0, 0, 0, 1))

Data and other attributes inherited from Leaf:
__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 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)
accept(self, visitor)
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)
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 Light(Leaf)
    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
 
 
Method resolution order:
Light
Leaf
__builtin__.object

Methods defined here:
__init__(self, ambient=(0.20000000000000001, 0.20000000000000001, 0.20000000000000001, 1.0), diffuse=(1.0, 1.0, 1.0, 1.0), specular=(1.0, 1.0, 1.0, 1.0), position=(0.0, 0.0, 0.0))

Data and other attributes inherited from Leaf:
__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 Mesh(Leaf)
    The Mesh leaf loads 3D model files. Currently, only .obj files are 
supported.
 
.filename is the filename of the obj file to load.
 
 
Method resolution order:
Mesh
Leaf
__builtin__.object

Methods defined here:
__init__(self, filename)

Data and other attributes inherited from Leaf:
__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 Polyline(Leaf)
    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.
 
 
Method resolution order:
Polyline
Leaf
__builtin__.object

Methods defined here:
__init__(self, vertices, width=1.0)

Data and other attributes inherited from Leaf:
__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 Quad(Leaf)
    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
 
 
Method resolution order:
Quad
Leaf
__builtin__.object

Methods defined here:
__init__(self, (w, h))

Data and other attributes inherited from Leaf:
__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 QuadList(Leaf)
    
Method resolution order:
QuadList
Leaf
__builtin__.object

Methods defined here:
__init__(self, vertices)

Data and other attributes inherited from Leaf:
__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 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 Sequence(Leaf)
    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.
 
 
Method resolution order:
Sequence
Leaf
__builtin__.object

Methods defined here:
__init__(self, (w, h), filename)

Data and other attributes inherited from Leaf:
__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 Sphere(Leaf)
    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
 
 
Method resolution order:
Sphere
Leaf
__builtin__.object

Methods defined here:
__init__(self, radius, x_segments=8, y_segments=8)

Data and other attributes inherited from Leaf:
__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 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 Text(Leaf)
    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.
 
 
Method resolution order:
Text
Leaf
__builtin__.object

Methods defined here:
__init__(self, text, font, foreground=(1, 1, 1), background=None, size=32)
get_text(self)
set_text(self, text)

Properties defined here:
text
get = get_text(self)
set = set_text(self, text)

Data and other attributes inherited from Leaf:
__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 Texture(Leaf)
    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
 
 
Method resolution order:
Texture
Leaf
__builtin__.object

Methods defined here:
__init__(self, filename, filter=True, mipmap=True)

Data and other attributes inherited from Leaf:
__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 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)