Dear Soya-users,

I've encountered a bug in Soya related to line drawing. After I
inquired about it on #soya, tid-wave told me it was a known bug and
requested that I provide a test-case. 

The bug is simply that lines are normally coloured when by themselves
or with simple objects (e.g., a simple face in the example below), but
they become dark when the scene has more complicated objects (e.g., a
pyramid in the example below).

To demonstrate the bug, run the script, then change the variable
'show_the_bug' from 1 to 0 and rerun it. I tested this script against
Soya 0.10.1 and CVS head of 15 October, and the bug is reproduced in
both.

When show_the_bug is 1, I seem to see the scene correctly rendered for
a brief moment, perhaps just the first frame.

I took a quick look at the Soya bug-tracker on gna.org, but it appears
not to be used (no open or closed bugs are listed), so I've posted
this straight to the mailing list. My apologies if this is improper.

Regards,

Rory (aka HappyFool)

==snip============================================================
import sys, os, os.path, soya

show_the_bug=1

soya.init()

scene = soya.World()

light = soya.Light(scene)
light.diffuse=(1,1,1,1)
light.set_xyz(0.5, 0.0, 2.0)

line=soya.World(scene)

v1=soya.Vertex(scene,0.0,0.0,0.0)
v2=soya.Vertex(scene,0.0,1.0,0.0)
v1.diffuse=(1,0,0,1)
v2.diffuse=(1,0,0,1)

soya.Face(line,
          [ v1,
            v2 ])

line.set_xyz(2,0,1)

if show_the_bug:
    pyramid = soya.World(scene)
    soya.Face(pyramid, [soya.Vertex(pyramid,  0.5, -0.5,  0.5),
                        soya.Vertex(pyramid, -0.5, -0.5,  0.5),
                        soya.Vertex(pyramid, -0.5, -0.5, -0.5),
                        soya.Vertex(pyramid,  0.5, -0.5, -0.5),
                        ])

    soya.Face(pyramid, [soya.Vertex(pyramid, -0.5, -0.5,  0.5),
                        soya.Vertex(pyramid,  0.5, -0.5,  0.5),
                        soya.Vertex(pyramid,  0.0,  0.5,  0.0),
                        ])

    soya.Face(pyramid, [soya.Vertex(pyramid,  0.5, -0.5, -0.5),
                        soya.Vertex(pyramid, -0.5, -0.5, -0.5),
                        soya.Vertex(pyramid,  0.0,  0.5,  0.0),
                        ])

    soya.Face(pyramid, [soya.Vertex(pyramid,  0.5, -0.5,  0.5),
                        soya.Vertex(pyramid,  0.5, -0.5, -0.5),
                        soya.Vertex(pyramid,  0.0,  0.5,  0.0),
                        ])

    soya.Face(pyramid, [soya.Vertex(pyramid, -0.5, -0.5, -0.5),
                        soya.Vertex(pyramid, -0.5, -0.5,  0.5),
                        soya.Vertex(pyramid,  0.0,  0.5,  0.0),
                        ])

    pyramid.z = -2
else:
    square=soya.World(scene)
    soya.Face(square,
              [ soya.Vertex(square,-0.5,-0.5,0),
                soya.Vertex(square,0.5,-0.5,0),
                soya.Vertex(square,0.5,0.5,0),
                soya.Vertex(square,-0.5,0.5,0)])

    square.z = -2

camera = soya.Camera(scene)
camera.z = 2.0

soya.set_root_widget(camera)
soya.Idler(scene).idle()


Reply via email to