views:

87

answers:

2

Hello,

I'm working in a course's project to predict the velocity and position of the solar system planets (and other objects). It will be really cool if I can visualize the predicted objects data, if it's possible generating 3D images, if in video that's amazing. Do you know any library that lets me to use this data to generate an image or video? (I don't care in which language)

Data:
- simulation step (time line step for a video)
- positions of the objects
- radius and/or colours of the objects

Thanks in advance, any suggestion is welcome.

+1  A: 

I have a very rough idea that might be useful as a starting point, although it would need quite a bit of fleshing out in order to look properly professional. Does your data give the position of each planet in space at a given point in time? If so, you could:

1) Project your position data into twospace if it was originally 3-D (allowing you to use 2-D methods to represent data that still looks like it's being displayed in 3-D on the screen)

2) The result should be a series of 2-D matrices storing the locations of your planets. Let the matrix elements be 1 if they correspond to the location of a planet, and let them be 0 otherwise. (If you were to plot the matrix, it would look like a handful of white dots on a black background.)

3) Use the use morphological dilation to take every position point and set the values of their neighbors to 1 instead of 0, so that when you plot you get a set of disc-shaped white objects centered on the points from step (2).

4) Use a program to write each matrix from (3) to an image file, and put them in a common folder.

5) At runtime, use another program to import each image from the folder one at a time, displaying them on the screen in the same figure window. The result should be that each image representing the planets at time t replaces the picture for time (t-1). This should look optically the same as if a video file were playing in that window.

The end result would be a moving-picture show of a bunch of white circles in orbit against a black background. Would that be useful?

estanford
Thanks for the idea, but, it's not the solution for what I need. Instead of a 2D the graphics should be 3D. I have all the data (radius, position, velocity, etc ... for each time step) and looking for an easy way to draw it. Actually, I'm using gnuplot and graphing a 3D image, but I think there should be a better way. Thanks!
Jonathan Barbero
+1  A: 

There are several approaches that I've used (all via Python) for this type of visualization:

VPython is super easy to learn and you'll be able to get dynamic 3D visualization of planets spinning around a sun in minutes. There are contributions to help make movies as well, but I haven't used these.

One can also just use OpenGL directly, via, say, PyOpenGL within a wxPython window, or, using, for example, PyGlet. This approach is a bit more basic than VPython and will probably take longer to do, and the only way I know to make movies is via screenshots, etc.

VTK is an very impressive 3D visualization library, but is much harder to learn. VTK, like the others, will do dynamic visualization out-of-the-box, and it's the only one that has a built-in module for making images and movies. It is, though, a much more complicated library, but if you want planets spinning around a star, with a contour plot of a gas cloud, in the midst of a vector-field ion-storm, VTK can do it. There's also MayaVi which makes VTK a bit more accessible and interactive.

tom10
Thanks! I will take a look to VPython.
Jonathan Barbero
I tried it. It's really cool, I like it, but it isn't useful for what I want. The reason is that the vectors of the planets (or any astronomical object) have big numbers. The use case for vpython is for objects in close positions. Nice tool, but not for my use case. Thanks!
Jonathan Barbero
Can't you just scale everything down? Sure, the universe is big, but your computer screen is small, so just divide everything by 10^9 or whatever you need.
tom10