Changeset 4495


Ignore:
Timestamp:
Jun 18, 2020 12:03:52 PM (15 months ago)
Author:
vondreele
Message:

Improve lighting for unit cell box & view point cross

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4494 r4495  
    84428442        GL.glEnable(GL.GL_LIGHT0)
    84438443        GL.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE,0)
    8444         GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.1,.1,.1,1])
    8445         GL.glLightfv(GL.GL_LIGHT0,GL.GL_DIFFUSE,[.8,.8,.8,1])
     8444        GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.2,.2,.2,1])
     8445        GL.glLightfv(GL.GL_LIGHT0,GL.GL_DIFFUSE,[.7,.7,.7,1])
    84468446#        glLightfv(GL_LIGHT0,GL_SPECULAR,[1,1,1,1])
    84478447#        glLightfv(GL_LIGHT0,GL_POSITION,[0,0,1,1])
     
    86118611
    86128612    def RenderBox():
     8613        GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.4,.4,.4,1])
    86138614        GL.glEnable(GL.GL_COLOR_MATERIAL)
    86148615        GL.glLineWidth(2)
     
    86268627        GL.glDisable(GL.GL_BLEND)
    86278628        GL.glDisable(GL.GL_COLOR_MATERIAL)
     8629        GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.2,.2,.2,1])
    86288630       
    86298631    def RenderUnitVectors(x,y,z):
     8632        GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.7,.7,.7,1])
    86308633        GL.glEnable(GL.GL_COLOR_MATERIAL)
    86318634        GL.glLineWidth(2)
     
    86478650        GL.glDisable(GL.GL_BLEND)
    86488651        GL.glDisable(GL.GL_COLOR_MATERIAL)
     8652        GL.glLightfv(GL.GL_LIGHT0,GL.GL_AMBIENT,[.2,.2,.2,1])
    86498653       
    86508654    def RenderPlane(plane,color):
     
    89088912                           
    89098913    def Draw(caller='',Fade=[]):
    8910 #useful debug?       
    8911 #        if caller:
    8912 #            print (caller,generalData['Name'])
    8913 #    Bob: why not use a traceback? See GSASIIobj.HowDidIgetHere()
    8914 # end of useful debug
    89158914        vdWRadii = generalData['vdWRadii']
    89168915        mapData = generalData['Map']
     
    89888987        GL.glTranslate(-Tx,-Ty,-Tz)
    89898988        drawingData['modelView'] = GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX)
     8989        if drawingData['unitCellBox']:
     8990            RenderBox()
     8991            if drawingData['Plane'][1]:
     8992                H,phase,stack,phase,color = drawingData['Plane']
     8993                Planes = G2lat.PlaneIntercepts(Amat,H,phase,stack)
     8994                for plane in Planes:
     8995                    RenderPlane(plane,color)
    89908996        if drawingData['showABC']:
    89918997            x,y,z = drawingData['viewPoint'][0]
     
    92149220                Backbone = Backbones[chain]
    92159221                RenderBackbone(Backbone,BackboneColor,bondR)
    9216         if drawingData['unitCellBox']:
    9217             RenderBox()
    9218             if drawingData['Plane'][1]:
    9219                 H,phase,stack,phase,color = drawingData['Plane']
    9220                 Planes = G2lat.PlaneIntercepts(Amat,H,phase,stack)
    9221                 for plane in Planes:
    9222                     RenderPlane(plane,color)
    92239222        if drawingData.get('showSlice',False):
    92249223            global contourSet,Zslice
Note: See TracChangeset for help on using the changeset viewer.