I'm an educator specialising in physics / astrophysics. I have been teaching myself C++ and have made several simple programs to test my understanding.
Two examples of these are 1. an energy / friction etc. analysis tool for a model rollercoaster, and 2. a vector calculator.
Both programs are Win32 console applications which have been written using Visual 2010 C++ and are simple cin / cout programs.
I would like to take the vector program a little further.
Currently it asks the user for magnitudes / direction for each vector. Then once entered, it calculates the resultant vector and displays the solution on screen.
My goal is to do this but also provide a graphical display of the answer. That is, draw lines / arrows for the input vectors and resultant vector.
I understand that OpenGL may not be the way to go; I have already worked a little using this.
Can anyone please suggest a good library / header etc. that will be useful?
Having both the mathematics and graphics displayed on the one screen would be good.
I feel that using OpenGL works just fine. If you don't want to get your hands dirty in WinAPI, consider using a media library such as SDL2 or SFML 2.1. It's much more quicker to get something on screen (and reduces hair loss :P).
I'm reading up on SDL now and it seems pretty straight forward.
Yes, physics is awesome! I love learning it and teaching it to my students. It is a subject that can just about describe everything, or at least, attempt to.
I'm very much enjoying programming as I can directly apply my physics and mathematics knowledge. I have many program ideas to work on. Ultimately, I wish to develop my own experiment simulators for students who learn externally and do not have access to a laboratory. I understand that these programs already exist but it's fun making them from scratch.
Thanks! I just finished a course in 3d Game Engine design so what you described just now is basically what I just did. Unfortunately I did not excel in the course (only got a B) because a lot of the physics material was very new to me. We covered some things like when a sphere collides with a plane the formula may look familiar, v' = 2*(-v dot n)*n + v.
It was all very interesting and I am hoping to have a better understanding once I complete physics next semester!
Just note that if you want your vectors to be in 3 dimensions, SDL or SFML won't really do it for you unless you add OpenGL to the mix as well. However, you can use SFML (or something like GLFW) to open the window and set up a context for you, and then draw with OpenGL. There are a number of good tutorials on OpenGL around. If you don't like OpenGL for whatever reason, and you are fine with just using windows, DirectX is another low-level 3D drawing system.
Thanks for your reply. I'm only dealing with 2D vectors at the moment. However, I do intend to include the third dimension as soon as I solve my current challenge.
Would it be better to use SFML (or GLFW) for this reason or use SDL in conjunction with OpenGL?
I have only programmed graphics with OpenGL so I would prefer to stick with it if I had to.
From my understanding, there will be two windows when the solution is displayed if I was to use SDL. (i.e. the SDL window would have the text, while the OpenGl windows displays the graphics.
Ideally, I would like to have all output information in the one window. I will have a go using what has been suggested to begin with anyway.