Domanda

I'm fairly familiar with basic programming concepts, and most of my programming experience lies in MATLAB. I have some experience with C/C++, but not very much. I want to teach myself C++ through a self-initiated project that I deem to be cool (because that will keep me motivated). Here is my idea:

I want to simulate an object (user-defined shape, mass, density, etc.) falling (user-specified height) into a liquid with an initially still surface (user-defined properties such as density, viscosity etc.). I want to visualize the splash created, using the appropriate physics. I don't need this to be a fancy video. What I'm looking for is: once the object hits the surface, there will be mathematical functions that define the shape of the surface at any given time after the hit (I will, of course, have to figure out the physics first). I want to find these shapes at given timepoints after the hit, say, every 0.1s, and then I can display the surfaces in quick succession, so it basically is a video showing how the surface shape changes with time.

Assuming I'm familiar with the physics involved, my questions are:

  1. Is this feasible, or am I being stupidly ambitious?
  2. I'm guessing I can't just use CodeBlocks for this because I'll need some graphics-based thing to do the visualization. Do you have suggestions? Visual basic, maybe?
  3. In your opinion, do you think I'll gain a decent amount of exposure to C++ through this project, or do you think I should focus on something less physics-ey (happens to be my major) and more...well...computer science-y?

Thank you!

È stato utile?

Soluzione

Since nobody has given a more detailed answer, I'll give it a shot.

  1. This is feasible. Although, I'm not sure about the difficulty of such a project for you if you've never had any experience with programming or C++.

  2. You can use codeblocks or whatever IDE you're using. You just need to download OpenGL or Qt or whatever libraries you will be using and configure codeblocks properly so it can compile and link everything. Visualization is a part of OpenGL. OpenGL (GLUT) creates a window in which it draws everything you told him to. Personally, I prefer Linux for OpenGL (and every other) stuff, but that is just me. A good text editor and g++ can go a long way. This is not a must, just sayin.

  3. Well, making a simulation of this kind will surely make you write a decent amount of code (couple of kLOC probably) and give you a great amount of exposure to C++ and it's features too (this is why I think it may be a bit difficult if you had no prior experience with C++).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top