3d programming without opengl

Discussion in 'Python' started by nelson -, Oct 31, 2006.

  1. nelson -

    nelson - Guest

    i want to build up a simple 3d interactive geometry application in
    python. Since i want to run it without 3D acceleration (a scene will
    be quite simple) I was wondering if there was a library in python that
    allow me to build 3D graphic without the need to use OpenGL.... I
    google but i can't find nothing interesting... (the best would be a
    pure python solution)

    nelson -, Oct 31, 2006
    1. Advertisements

  2. nelson -

    Paul McGuire Guest

    Here's a page (http://www.vrplumber.com/py3d.py) with links to 73 possible

    I've played with Slut (http://slut.sourceforge.net/) and it is quite easy to
    work with. Here's a Flash movie (recorded using Wink) of a sphere that I
    programmed and rotated about:
    http://www.geocities.com/ptmcg/python/sphere1.htm, and here is the program
    that created it: http://www.geocities.com/ptmcg/python/vecSlut2.py.txt.

    The demos that come with Slut are quite impressive, too. The Slut project
    web page summarizes them here
    (http://slut.sourceforge.net/examples/index.html), but the little videos
    don't do them justice.

    -- Paul
    Paul McGuire, Oct 31, 2006
    1. Advertisements

  3. nelson -

    Paul McGuire Guest

    Well, shoot, I killed my free bandwidth on GeoCities with that link to the
    Flash animation!

    I've uploaded a smaller video, should support 20-25 views/hour, instead of 3
    like the old one. Please bear with me.

    -- Paul
    Paul McGuire, Oct 31, 2006
  4. nelson -

    Steve Holden Guest

    Looks like c.l.py just slashdotted you ... """The GeoCities web site you
    were trying to view has temporarily exceeded its data transfer limit.
    Please try again later."""

    Steve Holden, Oct 31, 2006
  5. nelson -

    nelson - Guest

    Hi paul,
    i look at slut and it seem very good... Can i embed it into a
    wxpython application?

    nelson -, Oct 31, 2006
  6. nelson -

    Paul McGuire Guest

    It didn't take long either! I replaced the 1.4M .swf file with a 170K .swf
    file, so things seem to be working again. (My b/w limit is 4.2M/hour, but I
    can't complain when it's free!)

    -- Paul
    Paul McGuire, Oct 31, 2006
  7. nelson -

    Paul McGuire Guest

    I've no earthly idea, nelson, sorry. The sphere program is the extent of my
    slut experience (for which my wife is quite grateful!). I think the slut
    website mentions a mailing list, that should be able to answer your
    technical questions.

    Good luck!
    -- Paul
    Paul McGuire, Oct 31, 2006
  8. I have no idea why you would want to do that. The fact that the scene
    is simple shouldn't be the only reason. After all, if a user is able to
    run the latest <insert_game_or_modelling_package_here> but your simple
    scene runs much slower, he is going to assume there is something wrong
    with it.

    If the target user has even a simple 3D accelerator, you are taking a
    huge performance hit. That shouldn't be done without a good reason.
    What's more, giving it is should be a pure Python solution, you won't
    even take advantage of MMX/SSE/3d now!, which all recent processors
    have. I'm avoiding talking about raw Python performance here.

    I did that once, so that I could learn how to make a software renderer,
    but that's not your case, since it is a library you are looking for.
    Perhaps there are other requirements that require what you are asking
    for, but I can't see in your message.

    Stephen Eilert, Oct 31, 2006
  9. If you just want slow, it's probably easier to use OpenGL and
    just put calls to time.sleep() in strategic places.
    Oy. A pure Python solution would probably be _really_ slow.
    Grant Edwards, Oct 31, 2006
  10. Pure Python doesn't necessarily imply "no graphics drawing code written
    in some other language", though. You can get pretty far by using a 2D
    library for simple 3D rendering.

    Fredrik Lundh, Oct 31, 2006
  11. Someone wrote a 3D demo for the pygame.draw challenge*. It worked but
    unfortunately he didn't end up finishing and submitting it. It had severe
    performance limitations :)


    *: http://media.pyweek.org/static/pygame.draw-0606.html
    Richard Jones, Oct 31, 2006
  12. someone just posted this to reddit:


    which I'd say qualifies as simple 3D with pretty decent performance
    given what it does and what platform it runs on...

    Fredrik Lundh, Nov 1, 2006
  13. OK, that's a pretty cool demo :)

    My definition of "severe" would involve a slow-down if you tried to render
    several of those relatively simple objects :)

    On my Althon64 3500+ system running in Konqueror or Mozilla I can get four
    windows viewing that page before performance really starts to drag.

    I should convince Alex to dig up that old code - I always was curious to see
    it. Hmm.

    Richard Jones, Nov 1, 2006
  14. nelson -

    Will McGugan Guest

    If you are worried about running your 3d app on older machines, OpenGL
    will typically fall back to software rendering if the hardware isn't
    available. Although you would have to be running it on an ancient PC if
    that is an issue.

    If you really want to avoid OpenGL, then writing a custom 3D engine
    using flat shaded polys, with painters algorithm, rendered with your
    favourite gui toolkit isn't a great deal of work.

    Will McGugan
    Will McGugan, Nov 1, 2006
  15. That's true. OpenGL (which will do SW rendering) will
    certainly be available on most/all Linux machines (except for
    headless or text-only servers).
    Not true. None of my machines have hardware 3D acceleration.
    One is only 9 months old, the others are 2-3 years old.
    However, OpenGL's software rendering works fine and has
    sufficient performance for most things short of 3D video games.
    Grant Edwards, Nov 1, 2006
  16. nelson -

    Jordan Guest

    I don't thnk you should have any problems using Slut with wxpython - wx
    would be much less amazing if it couldn't do something like that. On
    the other hand, I thought that you were looking for something that
    doesn't use openGL and I think that Slut is built around it.

    Jordan, Nov 1, 2006
  17. nelson -

    Paul McGuire Guest

    Yes, slut *does* use OpenGL, so if that is in fact a poison pill for this
    app, it's a no-go. The only reason I posted my original pointer to is was
    to show that an OpenGL app doesn't require using a complicated API.

    -- Paul
    Paul McGuire, Nov 1, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.