PDA

View Full Version : 3D field visualization



Clash
08-20-2010, 06:37 AM
How I can implement this 3D visualization using OpenGL?
This is something like fog colored by temperature.

http://www.inselpix.com/images/clash/model.jpg
http://www.inselpix.com/images/clash/modelwitheffect.jpg

NeXEkho
08-20-2010, 07:57 AM
Build a texture containing the heat colours and overlay it using GL_BLEND and a quadrilateral that covers the entire screen. You can either blur it to make it nice and foggy or rely on GL's bilinear interpolation to make a not-quite-so-nice blur.

Clash
08-22-2010, 03:18 PM
Thank you very much.


Build a texture containing the heat colours

Can you explain a bit detailed - what kind of texture I should build (3D?) and how I can do it. May be you can advice a good example.

Dark Photon
08-23-2010, 05:08 AM
Build a texture containing the heat colours
Can you explain a bit detailed - what kind of texture I should build
Take a look at the legends here:

* http://www.opendx.org/inaction/datamining/images/original/uk-insure.jpg
* http://www.opendx.org/inaction/datamining/images/original/walmart5.jpg
* http://www.opendx.org/inaction/medical/images/original/eyeCornea.jpg
* http://www.opendx.org/inaction/datamining/images/original/neuralnet.jpg

OpenDX (http://www.opendx.org) contains one of these. VTK (http://www.vtk.org) probably as well (both open source). Other commercial packages such as AVS no doubt too.

Clash
08-23-2010, 12:29 PM
Take a look at the legends here:


Thank you, but I did not understand what you suggested.
Are you talking about using some library? May be this is a good way, but I already have program that do not use any graphic library and I just search a recipe to do 3D filed visualization like showed on example picture.

Dark Photon
08-23-2010, 05:36 PM
Thank you, but I did not understand what you suggested.
Are you talking about using some library?
No. You can see the color order in the legend, right? Slap those in a texture, turn on GL_LINEAR interpolation, and use that as your value-to-temperature-color lookup table.

Clash
08-24-2010, 04:23 AM
No. You can see the color order in the legend, right? Slap those in a texture, turn on GL_LINEAR interpolation, and use that as your value-to-temperature-color lookup table.

This is not a problem. I already have value-to-temperature look up table, but I do not know how to show this color "fog" using OpenGL. What feature of OpenGL should I use to draw that color "fog"?

ZbuffeR
08-24-2010, 10:13 AM
glTexSubImage2D the temperature value, and draw a textured quad with it.
Put some alpha transparency for good measure, a simple glColor4f(1,1,1,0.5) should do the trick with default GL_MODULATE texture blend mode.

Clash
08-25-2010, 12:49 AM
glTexSubImage2D the temperature value, and draw a textured quad with it.
Put some alpha transparency for good measure, a simple glColor4f(1,1,1,0.5) should do the trick with default GL_MODULATE texture blend mode.

Thank you for your advice. I only cannot understand how I can get 3D picture from 2d quad. I should draw a lot quads, right?

ZbuffeR
08-25-2010, 01:59 AM
In your second picture, the one with fog temperature, it looks only a simple textured quad was added.

Clash
08-25-2010, 03:08 AM
In your second picture, the one with fog temperature, it looks only a simple textured quad was added.

It is 3D really. May be this is not good angle, but it is 3D. It looks like _3D_ colored fog, not a simple quad. I can make a bit morу pictures (better resolution) if it can help.

Rosario Leonardi
08-25-2010, 05:48 AM
the question is:

You need to navigate through the room or you need only an isometric view?
In the first case you can a use particles system.
In the second case a quad over the floor should be OK.

Clash
08-25-2010, 06:26 AM
the question is:

You need to navigate through the room or you need only an isometric view?
In the first case you can a use particles system.
In the second case a quad over the floor should be OK.

I need only isometric view, but I think a quad over the floor will not be OK. What is the particles system?

I make more pictures to better understand what I need:

p3 (http://www.inselpix.com/images/clash/p3.png)
p4 (http://www.inselpix.com/images/clash/p4.png)
p5 (http://www.inselpix.com/images/clash/p5.png)

Please look at p5 especially. You can see on it at the left side some thing like transparent plane orthogonal to observation axis.

Rosario Leonardi
08-25-2010, 01:01 PM
Ok, so you need to view the 3D Object from different angle, so the quad over the float is not a suitable solution.
To display sampled data there are two ways.
A- 3D textures, basically is like a normal texture but with an additional dimension. Cause everything in openGL have to be rendered on polygons you have to generate some polygons to render the texture. 3D texture are usually rendered on a lot of plane that slice the texture. You can choose is use planes perpendicular to the axis, or generate at frame time planes perpendicular to the camera. 3D texture have a lot of nice properties but take a lot of memory.
B- Another solution is particles system, basically you render a point (or a quad) with a texture and a color where you have a sample. In this way a lot of point will form a volume. They are used to render smoke, fire, dust and leaf in video games.
Particle use less memory and are not confined in a volume, but are more difficult to implement.

For both solution you can find a lot of tutorial on the web.

Clash
08-26-2010, 01:16 AM
To display sampled data there are two ways.
...
For both solution you can find a lot of tutorial on the web.


Thank you very much.

I tried to search examples of using 3D texture, but did not found something good so far. May be you can advice some site or book with good examples.

Rosario Leonardi
08-26-2010, 12:09 PM
This should be enough:
www.csee.wvu.edu/~tmcgraw/cs570spring2009/lecture19.pdf

Clash
08-26-2010, 01:35 PM
This should be enough:
www.csee.wvu.edu/~tmcgraw/cs570spring2009/lecture19.pdf

Link is very useful. You helped me a lot. Thank you very much.