Question:
What computer language should I use for making 3d simulations?
2012-01-09 05:54:01 UTC
I already know FORTRAN 77, C++, and a little bit of JAVA, however everyone I talk to who is experienced in computer programming says that the languages I know are not designed to create complex simulations. I am creating biology and physics simulations. I need them to have high quality 3d graphics, I need to be able to animate them, and the language has to be one that can be used to solve complex equations and allow me to model them. I am probably going to have to use several computer languages.
Keep in mind that the computer languages I "know" I am still new to. I have only been practicing with them for 1-2 months depending on the language, and I have read about 11 books on the languages so that I can learn as much as I can.
Any help or direction would be greatly appreciated.
Also any direction as to where I can get reference material for mastery of what you propose would be appreciated as well.
Four answers:
Vincent G
2012-01-09 19:05:46 UTC
Graphics simulations will probably require you to access a graphic library of some sort, and the best one that is out there is OpenGL. The source code is written in C.

But once compiled in dll, a program written in almost any language will be able to access the graphics functions, making the language you use to develop the rest of the program not that relevant.

Selecting the language for the simulation proper depends on how heavy your computations are, and how much they would need resources compared with the display. If the simulation -- pure number crunching -- is the demanding aspect, then you could do a lot worse than to rely on the most efficient pure number processor there is, Fortran.

But Fortran is hard to master, it is like a Formula 1; if you do not know what you are doing, you can run yourself in the wall very quickly.



Since you are a relatively new programmer, I recommend that you go with C++, which will be a good middle road.

C# is some kind of Java clone, i.e. it uses a virtual machine layer that reduces performance somewhat, compared with C++. Having to pick between C# and Java, I would go with the later.
?
2012-01-09 15:36:02 UTC
C/C++ or Fortran 95 or greater. Fortran is not dead and is still reigning high in the scientific world. So if people say that Fortran is not being used, that is not true. Also, don't forget to use the optimized high level math libraries. LAPACK, SCALAPACK, BLAS, etc. One thing I like about Fortran is the array slicing (less looping constructs required). MATLAB is a good package, but in the CFD community it is observed to be much much slower than either C/C++ or Fortran.



I can get stuff done much faster in Fortran than I can in C/C++, but that's because I have probably been writing it significantly longer. From an engineers prospective, Fortran is quicker to develop in and is slightly faster. From a computer science view, C/C++ have some advantages if you're proficient in the language, but until you're completely competent in the language, it's hard to get all of that working without quite a bit of specific practice.



Also, once you start feeling comfortable with you coding ability, look into these



OpenMP (multiprocessing for shared memory processing)

MPI (message passing interface, between non-shared memory processors[different cpus]. You can also use it with shared memory processors to keep memory separate.)

CUDA/OpenCL - C based languages for massively parallel computations using graphics cards.



I actually don't prefer Java, except for maybe making GUIs. I feel the totally compiled languages are better to use. Python also creates a great interface with several libraries (Cython, F2py, pyMPI, PyCUDA, etc.).



Good Luck.
?
2012-01-09 13:58:29 UTC
Java will not do for the simulations if you really need calculative power.



Fortran 77 is a bad idea since no-one uses it anymore. C99 does all that F77 does and better.



Since you already know C++ I would settle for that one.
?
2012-01-09 15:13:46 UTC
Try VPython.



It is a spinoff of the Python language, and if you already know Python (if you don't it is EXTREMELY easy to learn), you are all set.



Simply look up VPython on Google, and you'll go to the site, VPython's home page. You can download it, and a very simple tutorial is already included in the VPython directory.



You will need Python 2.7 to run it, but that is VERY easy to install, too.



I use VPython for all sorts of math/science models, and when you get a good model going, it is very rewarding.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...