Language for 3d graphics

Started by
3 comments, last by Krohm 10 years, 6 months ago

Hey there, as a "new" programmer I was wondering what language would be better to learn graphics programming.

I was able to learn a bit about C language in the last month at a cs101 level and also I have been playing with python and pygame,

I was wondering if it would be better to learn 3d graphics with OpenGL using python or would be better if I learn some c++ and use that.

I wonder because I want to continue in the field of game logic but also I want to learn more about 3d graphics and got interested in buying a serie of books about it that sadly use c++ in all of them, would I be able to use python while following the c++ books or is better is I use c++ and forget about python ?

My explaination skills are not so great so sorry for that mess, thank for any help on explaining me this

Advertisement

OpenGL is originally in C. In other languages, it will look very similar (the same names of the functions etc).

However one of the important limitations in graphics is number of state calls

(now very important in mobile environments, less on desktops). As some of the calls must go

through system switch it may take a long time. In interpreted languages you will add additional

time for the interpretation (so it may be less efficient). But, this should be profiled, for being sure.

Maybe, start with Python and if it will be too slow, rewrite graphics to C and embed it in the Python?

You can try C# with XNA, you will find that a lot of crazy math is already implemented (Matrix operations, collisions, 3DModels...)
I started with Allegro (C ), then OpenGL(C/C++), then XNA(C#) which for me was the easier one.


In interpreted languages you will add additional
time for the interpretation (so it may be less efficient). But, this should be profiled, for being sure.
Maybe, start with Python and if it will be too slow, rewrite graphics to C and embed it in the Python?

I've written Python programs that call OpenGL functions - I've yet to encounter a situation where Python execution speed was of any relevance in the overall framerate profile.

Typically, slowdowns tend to stem from improper OpenGL usage, like changing GL state for every single triangle.

+---------------------------------------------------------------------+

| Game Dev video tutorials -> http://www.youtube.com/goranmilovano | +---------------------------------------------------------------------+

My two cents.

Stay away from dynamic languages - they don't maintain their promises. The lack of adequate type information might not be a problem for the compiler/interpreter but it is a damn problem in terms of documentation which results in higher mental processing by your side. I think it's worth noticing that documentation tools are quite behind.

Stay away from basic C, its amount of automation (lack of dtors and ctors) is definitely too low. "Core" C++ (inheritance, some light templating) will get you very far and with some basic C++0x the language is fairly efficient in terms of expressiveness.

If the books you're planning to buy are C++, you have to get C++. Otherwise, you'll just waste your efforts in translating the notions, instead of acquiring them.

Previously "Krohm"

This topic is closed to new replies.

Advertisement