Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
COLLADA (DAE) vizualization example
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andrey Nechypurenko  
View profile  
 More options Sep 18 2012, 4:28 pm
From: Andrey Nechypurenko <andreyn...@googlemail.com>
Date: Tue, 18 Sep 2012 13:28:39 -0700 (PDT)
Local: Tues, Sep 18 2012 4:28 pm
Subject: COLLADA (DAE) vizualization example

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Sep 18 2012, 6:27 pm
From: Nathan <nathan.sto...@gmail.com>
Date: Tue, 18 Sep 2012 16:27:10 -0600
Local: Tues, Sep 18 2012 6:27 pm
Subject: Re: COLLADA (DAE) vizualization example

On Tue, Sep 18, 2012 at 2:28 PM, Andrey Nechypurenko <

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/OldStyleRende rer.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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Nechypurenko  
View profile  
 More options Sep 20 2012, 6:03 pm
From: Andrey Nechypurenko <andreyn...@googlemail.com>
Date: Thu, 20 Sep 2012 15:03:45 -0700 (PDT)
Local: Thurs, Sep 20 2012 6:03 pm
Subject: Re: COLLADA (DAE) vizualization example

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Sep 20 2012, 6:13 pm
From: Nathan <nathan.sto...@gmail.com>
Date: Thu, 20 Sep 2012 16:13:57 -0600
Local: Thurs, Sep 20 2012 6:13 pm
Subject: Re: COLLADA (DAE) vizualization example

Cool!  It worked!

FYI, it displays a black screen until you click the mouse or press a
keyboard -- I don't know if that was intentional.

But I get this output:

daeview $ ./daeview.py
Running with OpenGL version: 2.1 ATI-1.0.29
Initializing shaders...
  phong
  lambert
  blinn
  constant
  texture
  done.
Creating GL buffer objects for geometry...
  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.
Renderer cleaning up

I attached a screenshot.  Apparently you drag the mouse around and get to
look at a model of a dashboard and steering wheel.

~ Nathan

  Screen Shot 2012-09-20 at 4.11.58 PM.png
268K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Nechypurenko  
View profile  
 More options Sep 20 2012, 6:22 pm
From: Andrey Nechypurenko <andreyn...@googlemail.com>
Date: Thu, 20 Sep 2012 15:22:44 -0700 (PDT)
Local: Thurs, Sep 20 2012 6:22 pm
Subject: Re: COLLADA (DAE) vizualization example

On Friday, September 21, 2012 12:13:58 AM UTC+2, Nathan wrote:

> Cool!  It worked!

Great!

> FYI, it displays a black screen until you click the mouse or press a
> keyboard -- I don't know if that was intentional.

That is odd... and definitely not intentional :-) . There is no such
problem on Windows or Linux. I have to investigate why it happens.

Could you please try what Jeff suggested at the end of this thread<https://github.com/pycollada/pycollada/pull/28>?
Probably he did not commit his changes yet but it should be easy to modify
your local copy to see if it solves the problem.

Thanks,
Andrey.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Sep 20 2012, 6:25 pm
From: Nathan <nathan.sto...@gmail.com>
Date: Thu, 20 Sep 2012 16:25:22 -0600
Local: Thurs, Sep 20 2012 6:25 pm
Subject: Re: COLLADA (DAE) vizualization example

On Thu, Sep 20, 2012 at 4:22 PM, Andrey Nechypurenko <

andreyn...@googlemail.com> wrote:

> Could you please try what Jeff suggested at the end of this thread<https://github.com/pycollada/pycollada/pull/28>?
> Probably he did not commit his changes yet but it should be easy to modify
> your local copy to see if it solves the problem.

> Thanks,
> Andrey.

I don't have "Pillow" installed, so I don't see how that would be relevant
(?)

~ Nathan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Nechypurenko  
View profile  
 More options Sep 20 2012, 6:26 pm
From: Andrey Nechypurenko <andreyn...@googlemail.com>
Date: Thu, 20 Sep 2012 15:26:26 -0700 (PDT)
Local: Thurs, Sep 20 2012 6:26 pm
Subject: Re: COLLADA (DAE) vizualization example

> Could you please try what Jeff suggested at the end of this thread<https://github.com/pycollada/pycollada/pull/28>?
> Probably he did not commit his changes yet but it should be easy to modify
> your local copy to see if it solves the problem.

Forget to say, that to display textures PIL should be also installed.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan  
View profile  
 More options Sep 20 2012, 6:30 pm
From: Nathan <nathan.sto...@gmail.com>
Date: Thu, 20 Sep 2012 16:30:02 -0600
Local: Thurs, Sep 20 2012 6:30 pm
Subject: Re: COLLADA (DAE) vizualization example

On Thu, Sep 20, 2012 at 4:26 PM, Andrey Nechypurenko <

andreyn...@googlemail.com> wrote:

> Could you please try what Jeff suggested at the end of this thread<https://github.com/pycollada/pycollada/pull/28>?
>> Probably he did not commit his changes yet but it should be easy to modify
>> your local copy to see if it solves the problem.

> Forget to say, that to display textures PIL should be also installed.

Ah, yes, that looks a bit nicer, doesn't it? (attachment)

~ Nathan

  Screen Shot 2012-09-20 at 4.29.20 PM.png
693K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrey Nechypurenko  
View profile  
 More options Sep 20 2012, 6:42 pm
From: Andrey Nechypurenko <andreyn...@googlemail.com>
Date: Thu, 20 Sep 2012 15:42:50 -0700 (PDT)
Local: Thurs, Sep 20 2012 6:42 pm
Subject: Re: COLLADA (DAE) vizualization example

> Ah, yes, that looks a bit nicer, doesn't it? (attachment)

Now it looks exactly as it should be! :-) Glad that you finally get it
running.

BTW, this file (cockpit) contains COLLADA animations for steering wheel and
arrows. I am currently extending this example to support animation. I think
it will considerably simplify development of the in-game user interface.
For programmers, the only thing they will need to know is the name of the
animation, for example, to rotate the steering wheel. How this animation
will actually looks like is specified by 3D artist using corresponding
animation support in Blender or whatever else 3D authoring tool.

Regarding the first repainting issue - without real investigation, I tend
to say that it is an pyglet's OSX-specific issue since it works fine on
Windows and Linux and do not see any reasons why the window is not updated
after being shown. But it is a kind of speculation. I did not really
investigate this particular problem yet.

--
Andrey.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »