#1
|
|||
|
|||
data display
Can Vizard be used to display scientific data. For example I would like to pass in a 2D matrix of values, and have it displayed as a colored surface or as a 3D plot. Also, if possible, can vizard change this object while the world is running
|
#2
|
|||
|
|||
Hi,
Yes, Vizard should be able to do this through the use of On-The-Fly objects. They allow you to create 3D geometry by specifying each 3D vertex manually. Once the object is created you can modify existing vertices. If you provide more detail of what you are doing I could supply you with a sample script. |
#3
|
|||
|
|||
What I would like to be able to do is have a set of X and Y coordinates, and then have a 2D matrix of values for the Z axis, to create a 3D surface plot.
I would also like to be able to create a cylinder, where the 2D matrix corresponds to the diameter of the cylinder at points along and around the cylinder. The result being a tube that is smooth at some points, and "spiky" at others. The data can be static, but if it can be manipulated in the running world, that would be great. I am hoping to be able to skip the middle step of coverting our data to another format to be able to import into Vizard. The basic reason I am asking this, is because we use VR manly for scientific visualization. The software we are using now does these surfaces very easily, but lacks in navigation, manipulation and event triggering, among other things. If Vizard can prove to be a tool for displaying the scientific data we need, it will be a much greater asset than our current software. |
#4
|
|||
|
|||
Hi,
I've created an addon module to make it easy to create height fields. The attached zip file contains the modules (kgarr.py, HeightField.dlc) and a test script (testHeightField.py). I've commented the test script to explain what each command does. Let me know if this isn't what you wanted. I didn't implement the cylinder because I'm still not clear what it is supposed to look like. Do you have an image or a sample file? |
#5
|
|||
|
|||
Thanks, as soon as I get a sample of the cylinder, I will send it over.
One other question. Is it possible to apply a color map to the height values? something like this. It does not have to be exactly like that, but something simular. |
#6
|
|||
|
|||
Hi,
I've attached a modified version of the addon module that allows setting a color map. The sample script shows how to use this, it also displays a wireframe version of the heightfield over the colored version. |
#7
|
|||
|
|||
is it easy to get the data from a outside source, like the 50x50 CSV file attached.
|
#8
|
|||
|
|||
If this isn't easy, then I don't know what is
Code:
import csv height = [ [float(val) for val in row] for row in csv.reader(file('data.txt','rUb')) ] |
#9
|
|||
|
|||
Thanks Again!
Is it easy to map the color to the height of the surface, like in the picture above. For example, the highest points have an RGB value of 1 0 0 and the lowest points have a value of 0 0 0, any height between has a value between those. |
#10
|
|||
|
|||
here are some examples of the cylinder
the radius comes from a 2D matrix, one dimension being the points around the cylinder, the other being the points along the cylinder. |
#11
|
|||
|
|||
Hi,
I've attached a new version of the test script that generates colors based on the height. |
|
|