THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/11/2012 at 07:21, xxxxxxxx wrote:
Again a little problem I ran into, so here's a small and simplified piece of code:
def Draw(self, doc, data, bd, bh, bt, flags) :
gplist = [c4d.Vector(-100, -100, 300), c4d.Vector(100, -100, 300), c4d.Vector(100, -100, 500), c4d.Vector(-100, -100, 500), c4d.Vector(-100, 100, 300), c4d.Vector(100, 100, 300), c4d.Vector(100, 100, 500), c4d.Vector(-100, 100, 500)]
polys = 
polys.extend([c4d.CPolygon(0, 1, 2, 3), c4d.CPolygon(4, 7, 6, 5), c4d.CPolygon(0, 3, 7, 4), c4d.CPolygon(1, 5, 6, 2), c4d.CPolygon(0, 4, 5, 1), c4d.CPolygon(2, 6, 7, 3)])
poly = c4d.PolygonObject(8,6)
for i in range (0, 8) :
for i in range (0, 6) :
poly[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0,1,0)
bd.DrawPolygonObject(bh, poly, c4d.DRAWOBJECT_USE_OBJECT_COLOR)
This code draws a cube into the scene, so far so good. But depending on the position of the camera it disappears. I experienced this with nearly all methods to draw stuff (DrawLine, DrawPolygon, DrawPolygonObject), but not all the time. Sometimes the DrawPolygon method works flawless, I can zoom into the scene without disappearing of the object, sometimes I can't. I think it may have something to do with clipping, or the z-buffer but couldn't find anything helpful in the SDK or via the forum search (I found this method "ZSensitiveFarClipping" but this just returns the value, and there's no corresponding method for setting a value. If it is even the cause of the behaviour). So maybe someone could help me out here.
On 01/11/2012 at 09:07, xxxxxxxx wrote:
Have you tried this dummy 2D object trick?
On 01/11/2012 at 09:23, xxxxxxxx wrote:
Just tried it, sadly it doesn't work. Maybe it really just works with the 2D methods, but I need to use the real 3D methods.
I just noticed that the cube disappears when I move the camera and the world origin leaves the viewport and is not seen anymore. Maybe that helps in any way to find out what this is all about.