Logo   Home Table of Contents    News  Dev Blogs  Gallery  Timeline  Legend  Tags  Sponsors 
Join us on... 
Banner

Current: Month Day, Year

9.1.13 Code of opengl/scene.py

opengl/scene provides all methods to deal with openGL scene settings. The file only contains 1 class:

Class Scene

This class is used to create the scene used in openGL

Variables

These variables are all preset by __init__.
namedescription
glob reference to global object.
env reference to environment object.
parent reference to parent window.
context OpenGL context of parent window.
shaders Reference to shaders.
update Parent update function to redraw elements.
floor Boolean value if floor is used.
floortex Reference to floor texture.
floorsize List of 3 elements presenting dimension of the floor.
floortexname Name of the floor texture.
sysmaterials List of system materials.
prims Dictionary of primitives.
visLights Reference to visible lights.
diamondskel Boolean value if diamond skeleton is used.
other_objects_invisible Boolean value if all objects are invisible
black System material black.
white System material white.
orange System material orange.
red System material red.
blues System material blues.
normal System material neutral normal map.

Methods:

nameparametersreturnsdescription
lowestPos posedlowest value Used to calculate the floor, returns 20 without baseclass.
createPrims lightNone Creates all primitives, axes, floor, light.
togglePrims name
status
None Toggle a primitive, floor can be the cuboid or a grid, skeleton is presented in pose color or normal color.
setFloor vNone Sets floor, also changes between cuboid or xzgrid to status v
getFloorSizeFloat Nonefloorsize as a float Returns floorsize. 10 in case of no basemesh
setFloorSize sq
d
None Sets floor size to size of the sq and density (thickness) d.
hasFloor Nonefloor Returns if scene has a floor.
floorTexture nameNone Sets a floor texture (if available).
getfloorTexture Nonename Returns name of floor texture.
modFloorTexture nameNone Modifies floor texture to new name.
newFloorPosition posedNone sets a new floor position to fit under character.
setObjectsInvisible valueNone Sets the value for other_objects_invisible
prepareSkeleton posedNone Prepare graphical presentation of skeleton. Posed mode: orange, normal mode blue, internal=no skeleton red.
hasSkeleton Noneavailable Returns if a skeleton is available.
delSkeleton NoneNone Deletes the skeleton, if available.
setDiamondSkeleton valueNone Toggles between diamond and stick-skeleton.
setYRotation angleNone set y rotation (only skeleton rotates)
draw proj_view_matrix
campos
offset
showskel
None draws the assets (lights, primitives, different skeletons).
cleanup NoneNone Frees textures of system materials.