DrawPolygon showing black triangles



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2012 at 17:19, xxxxxxxx wrote:

    I'm drawing a triangle with a color ramp in the Draw member of my ObjectData plugin using DrawPolygon.
    It all shows fine if I have Enhanced OpenGL turned on.
    If I have Enhanced OpenGL off, the triangle shows up black.
    I'm drawing the triangle in the drawpass==c4d.DRAWPASS_OBJECT
    Is there anything that I need to do to make it work with Enhanced OpenGL turned off?

    Rui Batista



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2012 at 17:28, xxxxxxxx wrote:

    Just found out that this only happens if my scene has any other polygonal object, besides my ObjectData object.
    Would this help to spot the problem?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/08/2012 at 17:31, xxxxxxxx wrote:

    Also found out that is the additional polygonal object is in the scene but it is not visible, the triangle shows the color ramp, even without Enhanced OpenGL turned on.
    As soon as a little bit of any polygonal object is shown in the editor, my DrawPolygon triangles appear black.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 23/08/2012 at 18:00, xxxxxxxx wrote:

    Anyone?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 23/08/2012 at 18:11, xxxxxxxx wrote:

    Hello Rui,

    This is the default-code of the DrawHelper plugin and it works fine with OpenGL, Enhanced OGL and Software-Mode here on Windows 7 x64.

    import  c4d  
    from    c4d     import Vector  
      
    def main() :  
      bd.SetMatrix_Matrix(op, bh.GetMg())  
      bd.SetTransparency(1)  
      points      = (  
          Vector(100, 0, 0),  
          Vector(0, 100, 0),  
          Vector(0, 0, 100),  
      )  
      colors      = (  
          Vector(1,0,0),   
          Vector(0,1,0),   
          Vector(0,0,1),  
      )  
      bd.DrawPolygon(points, colors)  
      
    main()
    

    PS: Back then, I didn't knew about the use of the drawpass flag, so it's not in the code. But adding if drawpass != c4d.DRAWPASS_OBJECT: return works fine, too.

    -Niklas



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 23/08/2012 at 18:26, xxxxxxxx wrote:

    My code was similar to that one, Niklas.
    Try using it with a polygonal object added to the scene to see if it is drawn black.
    But, in the meanwhile, I found out the solution.
    I just had to add the following before drawing the polygon:

    bd.SetLightList(c4d.BDRAW_SETLIGHTLIST_NOLIGHTS);

    Rui Batista


Log in to reply