3d programming

Discussion in 'OT Technology' started by piratepenguin, Feb 5, 2009.

  1. piratepenguin

    piratepenguin New Member

    Joined:
    Jun 18, 2006
    Messages:
    1,067
    Likes Received:
    0
    Location:
    Ireland
    helloh

    Who here does a lot of this?

    A couple of times I tried to look at it, but there's been blockers. It seems extremely complicated and mathematical, but now it would be cool to figure it out since we study a lot of the maths in my linear algebra classes.

    I'd like to be able to use C++ and Python, but mostly Python, and I want my work to work on all platforms. I'm guessing I'll be using the same library but different bindings. What libraries, books and other references should I be interested in?

    Thanks.
     
  2. CodeX

    CodeX Guest

    I've done it. If you use a library like D3D or OpenGL it's not so bad, just a matter of learning the library and understanding the basics of 3D geometry. If you write your own 3D graphics engine like I did it requires a good bit of math. I actually won a state programming competition in high school for my 3D engine, using DOS mode X, 320x240 :mamoru:

    This site is your friend for D3D: http://nexe.gamedev.net/
    And this one for OpenGL: http://nehe.gamedev.net/
    Also, gamedev.net forums always have tons of people talking about this stuff, become a member, you'll be glad you did.

    I actually wish this is what I was doing, but alas the software development industry is fickle, guess I am content with doing 2D GUI stuff
     
    Last edited by a moderator: Feb 5, 2009
  3. piratepenguin

    piratepenguin New Member

    Joined:
    Jun 18, 2006
    Messages:
    1,067
    Likes Received:
    0
    Location:
    Ireland
    Nice stuff, thanks.

    Writing a 3d engine entered my head. It'd be a lot of work and it'd be slow but to do the math and the work to build something very basic using SVG would be interesting. In fact and unsurprisingly it's been done: http://www.kevlindev.com/geometry/3D/js3d/index.htm Must study that code.

    I'll register on that site, cheers codex.
     
  4. CodeX

    CodeX Guest

    Yeah, writing the engine from scratch was an excellent learning experience for me. Took about 100 hours to get an engine that could display, rotate, and scale textured 3D models that I created with my own editor and were stored in my own file format.

    If you get into something like that you have to understand that no matter how much time and effort you put into it it WILL be shit compared to something like D3D. Just make sure you know it is an excercise in learning the concepts, and that you will almost certainly produce nothing useful.
     
  5. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    Haha dos mode x! That brings back memories.

    You might want to look at SDL too, it's a cross-platform wrapper on a lot of stuff, and has Python bindings.

    There used to be a definitive book on 3D graphics. Not sure if it still is, but if I can remember the name I'll link it.
     
  6. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
  7. piratepenguin

    piratepenguin New Member

    Joined:
    Jun 18, 2006
    Messages:
    1,067
    Likes Received:
    0
    Location:
    Ireland
    The Red book?

    edit: book looks good.

    My gay university library doesn't have it. Actually it has no results for OpenGL. It has CS or "computer applications" courses but alls they seem to do is Java :mamoru:

    SDL seems like a handy place to start writing some things.
     
  8. CodeX

    CodeX Guest

    uhhg...

    I took a "special topics" elective course on computer graphics during my junior year, the professor wanted us to use SDL. I asked if I could just use OpenGL since its basically the same thing except SDL is a convoluted wrapper designed to make it easier which I don't think it does if anything it reduces your control over your program. Long story short he said no, I said fuck you and went so far as to use D3D, and when my final project was 100x more involved than anyone elses he had no choice but to give me an A lol. Wish I still had that code, I wrote a scale model/simulation of the solar system. Used super high res textures I found, some as big as 12000x12000, along with bump and specular mapping. I even had a night texture for earth for the dark side of the planet that showed city lights. Used HDR so if you looked straight at the sun it would wash out almost anything else in your field of view. All the planets and the sun were to scale, as was their positioning and their orbits were driven by actual physics, which was surprisingly difficult to fine tune to the point that they were stable for more than a few years of simulation time lol. You could fly the camera around the whole thing using FPS style controls, mouse aim and WASD, increase or decrease the passage of time, etc. I even had over 150 moons all in the correct orbits, though honestly most were carbon copies
     

Share This Page