Changeset 369

Show
Ignore:
Timestamp:
11/12/02 15:15:28 (6 years ago)
Author:
sholloway
Message:

General cleanup and testing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBRapier/RBRapier/Renderer/Appearance/Lighting.py

    r341 r369  
    4242    TwoSided = 0 
    4343    ShadeModel = GL.GL_SMOOTH 
    44     SeperateSpecular = GL.GL_SINGLE_COLOR # GL.GL_SEPARATE_SPECULAR_COLOR 
    4544    AmbientColor = Vector.ColorVectorProperty('Ambient', (.2, .2, .2, 1.)) 
     45 
     46    # The following is not supported at the moment by PyOpenGL -- no constants! 
     47    #SeperateSpecular = GL.GL_SINGLE_COLOR # GL.GL_SEPARATE_SPECULAR_COLOR 
    4648 
    4749    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    4951    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    5052 
    51     def __init__(self, TwoSided=0, LocalViewer=0): 
    52         self.TwoSided = TwoSided 
    53         self.LocalViewer = LocalViewer 
     53    def __init__(self, **kw): 
     54        for name,value in kw.iteritems(): 
     55            setattr(self, name, value) 
    5456 
    5557    def Select(self, context): 
     
    5961        GL.glLightModel(GL.GL_LIGHT_MODEL_TWO_SIDE, self.TwoSided) 
    6062        GL.glLightModel(GL.GL_LIGHT_MODEL_LOCAL_VIEWER, self.LocalViewer) 
    61         GL.glLightModel(GL.GL_LIGHT_MODEL_COLOR_CONTROL, self.SeperateSpecular) 
     63 
     64        # The following is not supported at the moment by PyOpenGL -- no constants! 
     65        #GL.glLightModel(GL.GL_LIGHT_MODEL_COLOR_CONTROL, self.SeperateSpecular) 
    6266 
    6367    def Deselect(self, context): 
     
    8589    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    8690 
    87     def __init__(self, LightNumber=None): 
     91    def __init__(self, LightNumber=None, **kw): 
    8892        self.LightNumber = LightNumber 
     93        for name,value in kw.iteritems(): 
     94            setattr(self, name, value) 
    8995 
    9096    def Select(self, context): 
     
    130136 
    131137    SpotDirection = Vector.UnitVector3Property('SpotDirection', (0., 0., -1.)) 
    132     SpotExponent = None #0.0 
    133     SpotCutoff = None #180.0 
     138    SpotExponent = 0.0 
     139    SpotCutoff = 180.0 
    134140 
    135141    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBRapier/RBRapier/Renderer/Appearance/PolygonRasterization.py

    r341 r369  
    4343    #~ Public Methods  
    4444    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     45 
     46    def __init__(self, FrontFace=None, CullFace=None): 
     47        if FrontFace is not None: self.FrontFace = FrontFace 
     48        if CullFace is not None: self.CullFace = CullFace 
    4549 
    4650    def Select(self, context): 
  • trunk/RBRapier/RBRapier/Renderer/Geometry/ArrayTraversal.py

    r351 r369  
    4242    'tristrip': GL.GL_TRIANGLE_STRIP, 
    4343    } 
    44 _ReversePrimitiveMap = dict([(y,x) for (x,y) in _PrimitveMap.iteritems()]) 
    4544 
     45_PrimitveStatsMap = { 
     46    GL.GL_POINTS: ('points', lambda count: count), 
     47 
     48    GL.GL_LINES: ('lines', lambda count: count/2), 
     49    GL.GL_LINE_STRIP: ('lines', lambda count: count-1), 
     50 
     51    GL.GL_TRIANGLES: ('triangles', lambda count: count/3), 
     52    GL.GL_TRIANGLE_FAN: ('triangles', lambda count: count-2),  
     53    GL.GL_TRIANGLE_STRIP: ('triangles', lambda count: count-2),  
     54    } 
     55     
    4656#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4757#~ Definitions  
     
    4959 
    5060def GenerateStatistics(self, context): 
    51     context.Statistics[self.PrimitiveName] = self._PrimitiveCount + context.Statistics.get(self.PrimitiveName, 0) 
     61    StatName, StatResults = self._StatsData 
     62    try:  
     63        context.Statistics[StatName] += StatResults 
     64    except KeyError: 
     65        context.Statistics[StatName] = StatResults 
    5266 
    5367class RangedTraversal(object): 
     
    6680    def __init__(self, primitive, rangecollection): 
    6781        self.primitive = _PrimitveMap.get(primitive, primitive) 
    68         self.PrimitiveName = _ReversePrimitiveMap.get(self.primitive, str(primitive)) 
    6982        self.rangecollection = rangecollection 
    7083 
     84        StatName, StatCalc = _PrimitveStatsMap[self.primitive] 
     85        StatResults = 0 
    7186        for RangeStart, RangeEnd in self.datacollection:  
    72             self._PrimitiveCount += RangeEnd - RangeStart 
     87            StatResults += StatCalc(RangeEnd - RangeStart) 
     88        self._StatsData = StatName, StatResults 
    7389 
    7490    GenerateStatistics = GenerateStatistics 
     
    104120    def __init__(self, primitive, datacollection, format=None): 
    105121        self.primitive = _PrimitveMap.get(primitive, primitive) 
    106         self.PrimitiveName = _ReversePrimitiveMap.get(self.primitive, str(primitive)) 
    107122        if format is None: format = self._DefaultFormat 
    108123        self.datacollection = [Numeric.asarray(data, format) for data in datacollection] 
    109124 
     125        StatName, StatCalc = _PrimitveStatsMap[self.primitive] 
     126        StatResults = 0 
    110127        for each in self.datacollection:  
    111             self._PrimitiveCount += len(each) 
     128            StatResults += StatCalc(len(each)) 
     129        self._StatsData = StatName, StatResults 
    112130 
    113131        self._glDrawElements = self._glDrawElementsCall[format]  
  • trunk/RBRapier/RBRapier/Renderer/SequenceMgr.py

    r362 r369  
    4343class SequenceBase(object): 
    4444    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     45    #~ Constants / Variables / Etc.  
     46    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     47 
     48    SetupPhase = -2 
     49    ManagerPhase = -1 
     50    GeneralPhase = 0 
     51    PostPhase = 1 
     52 
     53    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4554    #~ Public Methods  
    4655    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    5362        self.OnEndExecute = SubjectList() 
    5463 
    55     def AddElement(self, Element, priority=0): 
     64    def AddSetupElement(self, Element, PriorityDelta=0): 
     65        self._AddElement(Element, self.SetupPhase + PriorityDelta) 
     66 
     67    def AddManagerElement(self, Element, PriorityDelta=0): 
     68        self._AddElement(Element, self.ManagerPhase + PriorityDelta) 
     69 
     70    def AddPostElement(self, Element, PriorityDelta=0): 
     71        self._AddElement(Element, self.PostPhase + PriorityDelta) 
     72 
     73    def AddElement(self, Element, priority=None): 
     74        if priority is None:  
     75            priority = self.GeneralPhase 
     76        self._AddElement(Element, priority) 
     77 
     78    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     79 
     80    def RemoveElement(self, Element): 
     81        self.Elements[:] = [x for x in self.Elements if x[-1] != Element] 
     82        self.OnRemoveElement.Update(Element) 
     83 
     84    def Execute(self, context): 
     85        self.OnBeginExecute.Update(context) 
     86        for priority, elementfn, element in self.Elements: 
     87            if getattr(element, 'Active', 1): 
     88                elementfn(context) 
     89        self.OnEndExecute.Update(context) 
     90    Draw = Execute 
     91 
     92    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     93    #~ Protected Methods  
     94    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     95 
     96    def _AddElement(self, Element, priority=0): 
    5697        if priority <= 0: 
    5798            idx = bisect.bisect_right(self.Elements, (priority, _MatchAll, _MatchAll)) 
     
    71112        self.OnAddElement.Update(Element) 
    72113 
    73     def RemoveElement(self, Element): 
    74         self.Elements[:] = [x for x in self.Elements if x[-1] != Element] 
    75         self.OnRemoveElement.Update(Element) 
    76  
    77     def Execute(self, context): 
    78         self.OnBeginExecute.Update(context) 
    79         for priority, elementfn, element in self.Elements: 
    80             if getattr(element, 'Active', 1): 
    81                 elementfn(context) 
    82         self.OnEndExecute.Update(context) 
    83     Draw = Execute 
    84  
    85114#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    86115 
    87116class Sequence(SequenceBase): 
     117    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     118    #~ Public Methods  
     119    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     120 
    88121    def __init__(self, ManagerAttribute=0, ManageBuffer=0): 
    89122        SequenceBase.__init__(self) 
     
    92125            self.AttributeMgr = AttributeMgr.AttributeEffector() 
    93126        else: self.AttributeMgr = AttributeMgr.AttributeTracker() 
    94         self.AddElement(self.AttributeMgr,-1
     127        self.AddManagerElement(self.AttributeMgr
    95128 
    96129        if ManageBuffer: 
    97130            self.BufferMgr = BufferMgr.BufferEffector() 
    98131        else: self.BufferMgr = BufferMgr.BufferTracker() 
    99         self.AddElement(self.BufferMgr,-1
     132        self.AddManagerElement(self.BufferMgr
    100133 
    101134#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBRapier/RBRapier/Renderer/View/TransformationSettings.py

    r341 r369  
    5050#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    5151 
    52 class PerspectiveHint(object) 
     52class PerspectiveHint(object): 
    5353    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    5454    #~ Constants / Variables / Etc.  
     
    5656 
    5757    AttributeChange = AttributeChangeElement(GL.GL_TRANSFORM_BIT) 
    58     PerspectiveHint = GL_DONT_CARE 
     58    PerspectiveHint = GL.GL_DONT_CARE 
    5959 
    6060    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • trunk/RBRapier/RBRapier/Renderer/View/Transformations.py

    r341 r369  
    4848    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    4949 
    50     def __init__(self, Mode=None, Save=0): 
    51         Transformations.Composite.__init__(self
     50    def __init__(self, Mode=None, Save=0, *args, **kw): 
     51        super(ManagedTransformationMixin, self).__init__(*args, **kw
    5252        self.Mode = Mode 
    5353        self.Save = Save 
     
    5959        if self.Mode: GL.glMatrixMode(GL.GL_MODELVIEW) 
    6060 
    61     def Deselect(self): 
     61    def Deselect(self, context): 
    6262        if self.Save: 
    6363            if self.Mode: 
     
    8282 
    8383class Matrix(Transformations.Matrix): 
    84     def Draw(self, context): 
     84    def Execute(self, context): 
    8585        GL.glMultMatrixd(transpose(self.matrix).tolist()) 
    8686    Draw = Execute 
    8787 
    8888class LoadMatrix(Transformations.Matrix): 
    89     def Draw(self, context): 
     89    def Execute(self, context): 
    9090        GL.glLoadMatrixd(transpose(self.matrix).tolist()) 
    9191    Draw = Execute 
    9292 
    9393class Identity(Transformations.Identity): 
    94     def Draw(self, context): 
     94    def Execute(self, context): 
    9595        pass # Uh.... don't use this? 
    9696    Draw = Execute 
    9797 
    9898class LoadIdentity(Transformations.Identity): 
    99     def Draw(self, context): 
     99    def Execute(self, context): 
    100100        GL.glLoadIdentity() 
    101101    Draw = Execute 
    102102 
    103103class Translate(Transformations.Translate): 
    104     def Draw(self, context): 
     104    def Execute(self, context): 
    105105        GL.glTranslated(*self.Direction[:3]) 
    106106    Draw = Execute 
    107107 
    108108class Scale(Transformations.Scale): 
    109     def Draw(self, context): 
     109    def Execute(self, context): 
    110110        GL.glScaled(*self.Scale[:3]) 
    111111    Draw = Execute 
    112112 
    113113class Rotate(Transformations.Rotate): 
    114     def Draw(self, context): 
     114    def Execute(self, context): 
    115115        GL.glRotated(self.Angle, *self.Axis[:3]) 
    116116    Draw = Execute 
    117117 
    118118class Quaternion(Quaternion.Quaternion): 
    119     def Draw(self, context): 
     119    def Execute(self, context): 
    120120        GL.glMultMatrixd(transpose(self.asArray4x4()).tolist()) 
    121121    Draw = Execute 
    122122 
    123123class LinearMappingMatrix(Transformations.LinearMappingMatrix): 
    124     def Draw(self, context): 
     124    def Execute(self, context): 
    125125        GL.glMultMatrixd(transpose(self.asArray4x4()).tolist()) 
    126126    Draw = Execute 
    127127 
    128128class LookAt(Transformations.LookAt): 
    129     def Draw(self, context): 
     129    def Execute(self, context): 
    130130        args= self.Eye.tolist() + self.Center.tolist() + self.Up.tolist() 
    131131        GLU.gluLookAt(*args) 
     
    133133 
    134134class SphericalLookAt(Transformations.SphericalLookAt): 
    135     def Draw(self, context): 
     135    def Execute(self, context): 
    136136        args= self.Eye.tolist() + self.Center.tolist() + self.Up.tolist() 
    137137        GLU.gluLookAt(*args) 
     
    139139 
    140140class Shear(Transformations.Shear): 
    141     def Draw(self, context): 
     141    def Execute(self, context): 
    142142        GL.glMultMatrixd(transpose(self.matrix).tolist()) 
    143143    Draw = Execute 
    144144 
    145145class Skew(Transformations.Skew): 
    146     def Draw(self, context): 
     146    def Execute(self, context): 
    147147        GL.glMultMatrixd(transpose(self.matrix).tolist()) 
    148148    Draw = Execute 
    149149 
     150#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     151#~ Title  
     152#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     153 
    150154class Orthographic(Projections.Orthographic): 
    151     def Draw(self, context): 
     155    def Execute(self, context): 
    152156        GL.glOrtho(self.Left, self.Right, self.Bottom, self.Top, self.Near, self.Far) 
    153157    Draw = Execute 
    154158 
    155159class Frustum(Projections.Frustum): 
    156     def Draw(self, context): 
     160    def Execute(self, context): 
    157161        GL.glFrustum(self.Left, self.Right, self.Bottom, self.Top, self.Near, self.Far) 
    158162    Draw = Execute 
    159163 
    160164class Perspective(Projections.Perspective): 
    161     def Draw(self, context): 
     165    def Execute(self, context): 
    162166        GL.glFrustum(self.Left, self.Right, self.Bottom, self.Top, self.Near, self.Far) 
    163167    Draw = Execute 
  • trunk/RBRapier/RBRapier/Tools/Geometry/Analysis/TriangleLister.py

    r366 r369  
    2828        result = [] 
    2929        if TaskProgress: 
    30             TaskProgress.SetProgressRange(0, len(mesh.Faces)/.9) 
     30            subtask = TaskProgress.NewSubtask('Triangle mesh listing', 0, len(mesh.Faces)/.9) 
    3131            mesh.Faces.sort() 
    32             TaskProgress.Percentage = 0.1 
     32            subtask.Percentage = 0.1 
    3333            for face in mesh.Faces: 
    3434                result.extend(face.v) 
    35                 TaskProgress += 1 
     35                subtask += 1 
    3636        else: 
    3737            mesh.Faces.sort() 
  • trunk/RBRapier/RBRapier/Tools/Geometry/Analysis/TriangleStripifier.py

    r366 r369  
    434434        CleanFacesTask = 0 
    435435        if TaskProgress: 
    436             StripifyTask = TaskProgress.NewSubtask("Stripify triangles", 0, len(mesh.Faces)) 
     436            StripifyTask = TaskProgress.NewSubtask("Triangle mesh stripification", 0, len(mesh.Faces)) 
    437437            if bCleanFaces:  
    438438                CleanFacesTask = TaskProgress.NewSubtask("Clean faces", 0, len(mesh.Faces)) 
  • trunk/RBRapier/demo/Lightwave/scene.py

    r366 r369  
    3232from RBRapier.Renderer.Environment import FragmentTests 
    3333from RBRapier.Renderer.View import Viewport 
     34from RBRapier.Renderer.View import Transformations 
     35from RBRapier.Renderer.View import TransformationSettings 
     36from RBRapier.Renderer.Appearance import PolygonRasterization 
     37from RBRapier.Renderer.Appearance import Lighting 
    3438 
    3539from RBRapier.Formats.Lightwave import MeshedObject 
     
    5256 
    5357        self.ClearColor = Buffers.ClearColor((0.,0.,0.,0.)) 
    54         self.Sequence.AddElement(self.ClearColor.Execute, -2) 
     58        self.Sequence.AddSetupElement(self.ClearColor.Execute) 
     59 
    5560        self.ClearDepth = Buffers.ClearDepth(1.) 
    56         self.Sequence.AddElement(self.ClearDepth.Execute, -2) 
     61        self.Sequence.AddSetupElement(self.ClearDepth.Execute) 
     62 
    5763        self.DepthTest = FragmentTests.DepthTest() 
    58         self.Sequence.AddElement(self.DepthTest.Select, -1) 
     64        self.Sequence.AddSetupElement(self.DepthTest.Select) 
     65 
     66        self.Normalization = TransformationSettings.Normalization() 
     67        self.Sequence.AddSetupElement(self.Normalization.Select) 
     68 
     69        self.Culling = PolygonRasterization.FaceCulling() 
     70        self.Sequence.AddSetupElement(self.Culling.Select) 
     71 
     72        self.Lighting = Lighting.LightingModel() 
     73        self.Sequence.AddElement(self.Lighting.Select) 
     74 
     75        self.Lights = [] 
     76        self.Lights.append(Lighting.Light(0)) 
     77        self.Lights[0].Specular = 0., 0., 1. 
     78        self.Lights[0].Diffuse = .3, .3, .4 
     79        self.Lights.append(Lighting.Light(1)) 
     80        self.Lights[1].Specular = 1., 0., 0. 
     81        self.Lights[1].Diffuse = .4, .3, .3 
     82        self.Lights.append(Lighting.SpotLight(2, SpotCutoff=10., SpotExponent=16.)) 
     83        self.Lights[2].Position = (0., .4, 0., 1.) 
     84        self.Lights[2].SpotDirection = (0., -1., 0., 0.) 
     85 
     86        #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    5987 
    6088        self.Viewport = Viewport.Viewport() 
    61         self.Sequence.AddElement(self.Viewport, -2) 
     89        self.Sequence.AddElement(self.Viewport.Execute) 
     90 
     91        self.Projection = Transformations.ManagedComposite(GL.GL_PROJECTION) 
     92        self.Sequence.AddElement(self.Projection.Select) 
     93        self.Sequence.AddPostElement(self.Projection.Deselect) 
     94 
     95        self.Projection.Add(Transformations.LoadIdentity()) 
     96        self.Projection.Perspective = Transformations.Perspective(8) 
     97        self.Projection.Add(self.Projection.Perspective) 
     98        self.Projection.Translate = Transformations.Translate((0, -0.05, -1.5)) 
     99        self.Projection.Add(self.Projection.Translate) 
     100        self.Projection.Rotate = Transformations.Rotate(30, (1, 0, 0)) 
     101        self.Projection.Add(self.Projection.Rotate) 
     102 
     103        self.Sequence.AddElement(self.Lights[2].Select) 
     104 
     105        self.ModelView = Transformations.ManagedComposite() 
     106        self.ModelView.Add(Transformations.LoadIdentity()) 
     107        self.ModelView.Rotate = Transformations.Rotate(60, (0, 1, 0)) 
     108        self.ModelView.Rotate.AngleDelta = 1. 
     109        self.ModelView.Add(self.ModelView.Rotate) 
     110        self.Sequence.AddElement(self.ModelView.Select) 
     111        self.Sequence.AddElement(self.Lights[0].Select) 
     112        self.Sequence.AddPostElement(self.ModelView.Deselect) 
     113 
     114        self.LightXForm = Transformations.ManagedComposite(Save=1) 
     115        self.LightXForm.Rotate = Transformations.Rotate(60, (0, 1, 0)) 
     116        self.LightXForm.Rotate.AngleDelta = -6. 
     117        self.LightXForm.Add(self.LightXForm.Rotate) 
     118        self.Sequence.AddElement(self.LightXForm.Select) 
     119        self.Sequence.AddElement(self.Lights[1].Select) 
     120        self.Sequence.AddElement(self.LightXForm.Deselect) 
    62121 
    63122        self.GeoObj = self.LigthwaveLWO('data/ki162a.lwo', 1, 3) 
     
    67126        #self.GeoObj = self.LigthwaveLWO('data/SIM.LWO', 1, 3) 
    68127 
    69         #GL.glEnable(GL.GL_NORMALIZE) 
    70         #GL.glEnable(GL.GL_COLOR_MATERIAL) 
    71         GL.glEnable(GL.GL_LIGHTING) 
    72         GL.glEnable(GL.GL_LIGHT0) 
    73         GL.glEnable(GL.GL_CULL_FACE) 
    74  
    75         #for each in self.Sequence.Elements: print each 
    76  
    77128    def StripColoredLigthwaveLWO(self, name, *args, **kw): 
    78129        builder = MeshedObject.MeshedObjectBuilder() 
     130        builder.GeoObjectFactory = GeoObject.DefaultGeoObject 
    79131        builder.IndexedTraversal = ArrayTraversal.ColoredIndexedCollectionTraversal 
    80132        GeoObj = builder.Build(open(name, 'rb'), *args, **kw) 
     
    89141        return GeoObj 
    90142 
    91     frustum = (-1,1,-1,1,1,100) 
    92     xlate = (0,0,-30) 
    93     rotate = (30, 1,0,0) 
     143    Animate = 1 
    94144    def Render(self, subject, canvas): 
     145        # Recalculate the viewport 
    95146        self.Viewport.SetRectangle(canvas.GetClientRect().asTuple()) 
    96  
    97         GL.glMatrixMode(GL.GL_PROJECTION) 
    98         GL.glLoadIdentity() 
    99         # Tiny 
    100         #GL.glOrtho(-.01,.01,-0.005,.01,-0.1,0.1) 
    101  
    102         # Small 
    103         #GL.glOrtho(-.1,.1,-.1,.2,-1,1) 
    104  
    105         GL.glFrustum(-.05,.05,-.025,.075,1,10) 
    106         GL.glTranslatef(0, 0, -2.5) 
    107         GL.glRotatef(30, 1, 0, 0) 
    108  
    109         # Medium 
    110         #GL.glOrtho(-0.5,0.5,-0.25,0.75,-1,1) 
    111  
    112         # Large 
    113         #GL.glFrustum(*self.frustum) 
    114         #GL.glTranslatef(*self.xlate) 
    115         #GL.glRotatef(*self.rotate) 
    116  
    117         GL.glMatrixMode(GL.GL_MODELVIEW) 
    118         GL.glRotatef(1., 0, 1, 0) 
    119         #GL.glRotatef(.7, 1, 0, 0) 
    120  
     147        self.Projection.Perspective.AspectRatio = self.Viewport.AspectRatio 
     148        # Draw the stuffage!  =) 
    121149        self.Sequence.Execute(None) 
    122         #print self.Sequence.Statistics 
     150        # Animation 
     151        if self.Animate: 
     152            self.ModelView.Rotate.Angle += self.ModelView.Rotate.AngleDelta 
     153            self.LightXForm.Rotate.Angle += self.LightXForm.Rotate.AngleDelta 
  • trunk/RBRapier/doc/DesignLayout.xml

    r341 r369  
    108108 
    109109        <package name='Managers'> 
    110             <module name='States'> 
    111                 Both client and global states 
    112                 Uses a checkpoint model 
    113             </module> 
    114             <module name='Attributes'> 
    115                 Uses a checkpoint model 
    116             </module> 
    117             <module name='BufferClearing'> 
    118                 Most effecient when clearing multiple buffers together... 
    119             </module> 
     110            <module name='States'/> 
     111            <module name='ClientStates'/> 
     112            <module name='Attributes'/> 
     113            <module name='BufferClearing'/> 
    120114            <module name='Display List Cache' /> 
    121115        </package>