Message from discussion
COLLADA (DAE) vizualization example
Received: by 10.58.64.16 with SMTP id k16mr585261ves.4.1348178626902;
Thu, 20 Sep 2012 15:03:46 -0700 (PDT)
X-BeenThere: pyglet-users@googlegroups.com
Received: by 10.52.156.112 with SMTP id wd16ls2356143vdb.6.gmail; Thu, 20 Sep
2012 15:03:45 -0700 (PDT)
Received: by 10.52.75.36 with SMTP id z4mr659502vdv.14.1348178625654;
Thu, 20 Sep 2012 15:03:45 -0700 (PDT)
Date: Thu, 20 Sep 2012 15:03:45 -0700 (PDT)
From: Andrey Nechypurenko <andreyn...@googlemail.com>
To: pyglet-users@googlegroups.com
Message-Id: <432618b5-ae52-4ad6-a702-0a8cfce184d0@googlegroups.com>
In-Reply-To: <CALtqtKSc7KsY60QUcH5V2_eXWFXqF+yoMyazJK=niu2D2gZzrA@mail.gmail.com>
References: <9b5f0b98-e876-4be4-b0c6-8f8492b4b0f2@googlegroups.com>
<CALtqtKSc7KsY60QUcH5V2_eXWFXqF+yoMyazJK=niu2D2gZzrA@mail.gmail.com>
Subject: Re: COLLADA (DAE) vizualization example
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1024_15173067.1348178625277"
------=_Part_1024_15173067.1348178625277
Content-Type: multipart/alternative;
boundary="----=_Part_1025_60815.1348178625277"
------=_Part_1025_60815.1348178625277
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Hi Nathan,
I could not comment on installation issues since I am neither maintainer of
pycollada nor experienced python developer.
Regarding daeview errors - you are right, there were couple of bugs when
running on Mac OSX (I have no Mac and did not test on OSX). Nevertheless,
with the help from Jeff Terrace these bugs are fixed now<https://github.com/pycollada/pycollada/pull/28>.
Please pull the new version from git if you like to try it once again.
BTW, this example is now merged into the main pycollada repository<https://github.com/pycollada/pycollada>.
So it is probably better to pull get the latest version from there.
Regards,
Andrey.
On Wednesday, September 19, 2012 12:27:12 AM UTC+2, Nathan wrote:
>
> On Tue, Sep 18, 2012 at 2:28 PM, Andrey Nechypurenko <
> andre...@googlemail.com <javascript:>> wrote:
>
>> Hi Folks,
>>
>> I am currently working on the project where it is necessary to visualize COLLADA
>> (DAE) <http://www.khronos.org/collada/> files. For these purposes I
>> decided for pyglet OpenGL wrappers and pycollada<http://pycollada.github.com/>(which is the library to read collada files). To learn how to do it I have
>> made an example<https://github.com/andreynech/pycollada/tree/master/examples/daeview>and just want to let pyglet community know about it. Maybe it could be
>> useful for somebody.
>>
>> The example has two renderers - the old-style which uses OpenGL display
>> lists and the modern-style which uses GLSL shaders and VBOs (with pyglet's
>> batches). So to some extent, it could be also considered as an example how
>> to visualize 3D models with pyglet using modern OpenGL techniques.
>>
>> Regards,
>> Andrey.
>>
>>
> Looks interesting--but it doesn't work for me. :-( Here's my experience:
>
> 1) 'python setup.py install' for pycollada failed trying to automatically
> install numpy
> 2) I installed numpy myself: 'pip install numpy'
> 3) Then installing pycollada worked.
> 4) examples/daeview.py crashed with this output:
>
> daeview $ python daeview.py
> Creating display list...
> It could take some time. Please be patient :-) .
> diffuse = Texture speedometr_bmp: (not available)
> diffuse = Texture compas_bmp: (not available)
> diffuse = Texture speedometr_bmp: (not available)
> diffuse = Texture earth2_jpg: (not available)
> done. Ready to render.
> Traceback (most recent call last):
> File "daeview.py", line 69, in <module>
> pyglet.app.run()
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/app/__init__.py",
> line 123, in run
> event_loop.run()
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/app/base.py",
> line 127, in run
> self._legacy_setup()
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/app/base.py",
> line 218, in _legacy_setup
> window.dispatch_pending_events()
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/window/cocoa/__init__.py",
> line 322, in dispatch_pending_events
> EventDispatcher.dispatch_event(self, *event)
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/event.py",
> line 355, in dispatch_event
> if handler(*args):
> File "daeview.py", line 26, in on_draw
> daerender.render(window.rotate_x, window.rotate_y, window.rotate_z)
> File
> "/Users/nathan/proj/extra/pycollada/examples/daeview/renderer/OldStyleRenderer.py",
> line 180, in render
> glCallList(self.displist)
> File
> "/Users/nathan/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pyglet/gl/lib.py",
> line 105, in errcheck
> raise GLException(msg)
> pyglet.gl.lib.GLException: invalid operation
>
> 5) So I switched the renderer in daeview.py to "GLSLRenderer" by swapping
> the commented renderer lines as instructed, and got this crash:
>
> daeview $ python daeview.py
> Running with OpenGL version:
> Traceback (most recent call last):
> File "daeview.py", line 63, in <module>
> daerender = renderer.GLSLRenderer(collada_file)
> File
> "/Users/nathan/proj/extra/pycollada/examples/daeview/renderer/GLSLRenderer.py",
> line 48, in __init__
> print 'Running with OpenGL version:', glutils.getOpenGLVersion()
> File
> "/Users/nathan/proj/extra/pycollada/examples/daeview/renderer/glutils.py",
> line 13, in getOpenGLVersion
> return cast(versionString, c_char_p).value
> NameError: global name 'cast' is not defined
>
>
> I'm using pyglet 1.2dev (completely up-to-date tip of the hg repo), python
> 2.7.3 installed via pythonbrew, on OS X 10.8.1.
>
> ~ Nathan
>
------=_Part_1025_60815.1348178625277
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi Nathan,<br><br>I could not comment on installation issues since I am nei=
ther maintainer of pycollada nor experienced python developer. <br><br>Rega=
rding daeview errors - you are right, there were couple of bugs when runnin=
g on Mac OSX (I have no Mac and did not test on OSX). Nevertheless, with th=
e help from <span name=3D"Jeff Terrace" class=3D"gD">Jeff Terrace</span> <a=
href=3D"https://github.com/pycollada/pycollada/pull/28">these bugs are fix=
ed now</a>. Please pull the new version from git if you like to try it once=
again.<br><br>BTW, this example is now merged into the <a href=3D"https://=
github.com/pycollada/pycollada">main pycollada repository</a>. So it is pro=
bably better to pull get the latest version from there.<br><br>Regards,<br>=
Andrey.<br><br>On Wednesday, September 19, 2012 12:27:12 AM UTC+2, Nathan w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;"><div class=3D"gmail_quote=
">On Tue, Sep 18, 2012 at 2:28 PM, Andrey Nechypurenko <span dir=3D"ltr">&l=
t;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"bdvxuR=
GzuAUJ">andre...@googlemail.com</a>></span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
Hi Folks,<br><br>I am currently working on the project where it is necessar=
y to visualize <a href=3D"http://www.khronos.org/collada/" target=3D"_blank=
">COLLADA (DAE)</a> files. For these purposes I decided for pyglet OpenGL w=
rappers and <a href=3D"http://pycollada.github.com/" target=3D"_blank">pyco=
llada</a> (which is the library to read collada files). To learn how to do =
it I have made <a href=3D"https://github.com/andreynech/pycollada/tree/mast=
er/examples/daeview" target=3D"_blank">an example</a> and just want to let =
pyglet community know about it. Maybe it could be useful for somebody.<br>
<br>The example has two renderers - the old-style which uses OpenGL display=
lists and the modern-style which uses GLSL shaders and VBOs (with pyglet's=
batches). So to some extent, it could be also considered as an example how=
to visualize 3D models with pyglet using modern OpenGL techniques.<br>
<br>Regards,<br>Andrey.<span><font color=3D"#888888"><br><br></font></span>=
</blockquote><div><br></div><div>Looks interesting--but it doesn't work for=
me. :-( Here's my experience:</div><div><br></div>
<div>1) 'python setup.py install' for pycollada failed trying to automatica=
lly install numpy</div><div>2) I installed numpy myself: 'pip install numpy=
'</div><div>3) Then installing pycollada worked.</div><div>
4) examples/daeview.py crashed with this output:</div><div><br></div><div><=
div>daeview $ python daeview.py </div><div>Creating display list...</d=
iv><div>It could take some time. Please be patient :-) .</div><div> d=
iffuse =3D Texture speedometr_bmp: (not available)</div>
<div> diffuse =3D Texture compas_bmp: (not available)</div><div> =
; diffuse =3D Texture speedometr_bmp: (not available)</div><div> diff=
use =3D Texture earth2_jpg: (not available)</div><div>done. Ready to render=
.</div><div>Traceback (most recent call last):</div>
<div> File "daeview.py", line 69, in <module></div><div> =
pyglet.app.run()</div><div> File "/Users/nathan/.pythonbrew/<w=
br>pythons/Python-2.7.3/lib/<wbr>python2.7/site-packages/<wbr>pyglet/app/__=
init__.py", line 123, in run</div>
<div> event_loop.run()</div><div> File "/Users/nathan/.p=
ythonbrew/<wbr>pythons/Python-2.7.3/lib/<wbr>python2.7/site-packages/<wbr>p=
yglet/app/base.py", line 127, in run</div><div> self._legacy_s=
etup()</div><div> File "/Users/nathan/.pythonbrew/<wbr>pythons/Python=
-2.7.3/lib/<wbr>python2.7/site-packages/<wbr>pyglet/app/base.py", line 218,=
in _legacy_setup</div>
<div> window.dispatch_pending_<wbr>events()</div><div> F=
ile "/Users/nathan/.pythonbrew/<wbr>pythons/Python-2.7.3/lib/<wbr>python2.7=
/site-packages/<wbr>pyglet/window/cocoa/__init__.<wbr>py", line 322, in dis=
patch_pending_events</div>
<div> EventDispatcher.dispatch_<wbr>event(self, *event)</div><=
div> File "/Users/nathan/.pythonbrew/<wbr>pythons/Python-2.7.3/lib/<w=
br>python2.7/site-packages/<wbr>pyglet/event.py", line 355, in dispatch_eve=
nt</div><div> if handler(*args):</div>
<div> File "daeview.py", line 26, in on_draw</div><div> =
daerender.render(window.<wbr>rotate_x, window.rotate_y, window.rotate_z)</d=
iv><div> File "/Users/nathan/proj/extra/<wbr>pycollada/examples/daevi=
ew/<wbr>renderer/OldStyleRenderer.py", line 180, in render</div>
<div> glCallList(self.displist)</div><div> File "/Users/=
nathan/.pythonbrew/<wbr>pythons/Python-2.7.3/lib/<wbr>python2.7/site-packag=
es/<wbr>pyglet/gl/lib.py", line 105, in errcheck</div><div> ra=
ise GLException(msg)</div>
<div>pyglet.gl.lib.GLException: invalid operation</div></div><div><br></div=
><div>5) So I switched the renderer in daeview.py to "GLSLRenderer" by swap=
ping the commented renderer lines as instructed, and got this crash:</div>
<div><br></div><div><div>daeview $ python daeview.py </div><div>Runnin=
g with OpenGL version:</div><div>Traceback (most recent call last):</div><d=
iv> File "daeview.py", line 63, in <module></div><div> &n=
bsp; daerender =3D renderer.GLSLRenderer(collada_<wbr>file)</div>
<div> File "/Users/nathan/proj/extra/<wbr>pycollada/examples/daeview/=
<wbr>renderer/GLSLRenderer.py", line 48, in __init__</div><div>  =
; print 'Running with OpenGL version:', glutils.getOpenGLVersion()</div><di=
v> File "/Users/nathan/proj/extra/<wbr>pycollada/examples/daeview/<wb=
r>renderer/glutils.py", line 13, in getOpenGLVersion</div>
<div> return cast(versionString, c_char_p).value</div><div>Nam=
eError: global name 'cast' is not defined</div></div><div><br></div><div><b=
r></div><div>I'm using pyglet 1.2dev (completely up-to-date tip of the hg r=
epo), python 2.7.3 installed via pythonbrew, on OS X 10.8.1.</div>
<div><br></div><div>~ Nathan</div></div>
</blockquote>
------=_Part_1025_60815.1348178625277--
------=_Part_1024_15173067.1348178625277--