WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-07-2006, 10:41 AM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
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
Reply With Quote
  #2  
Old 02-07-2006, 04:51 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 02-07-2006, 07:34 PM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
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.
Reply With Quote
  #4  
Old 02-08-2006, 11:07 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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?
Attached Files
File Type: zip kgarr.zip (7.3 KB, 823 views)
Reply With Quote
  #5  
Old 02-08-2006, 01:03 PM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
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.
Reply With Quote
  #6  
Old 02-08-2006, 02:59 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Attached Files
File Type: zip kgarr.zip (10.0 KB, 828 views)
Reply With Quote
  #7  
Old 02-08-2006, 05:52 PM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
is it easy to get the data from a outside source, like the 50x50 CSV file attached.
Attached Files
File Type: txt data.txt (15.9 KB, 792 views)
Reply With Quote
  #8  
Old 02-09-2006, 09:18 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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')) ]
Reply With Quote
  #9  
Old 02-09-2006, 11:14 AM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
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.
Reply With Quote
  #10  
Old 02-09-2006, 11:44 AM
kgarr kgarr is offline
Member
 
Join Date: Jan 2006
Location: Glassboro, NJ
Posts: 22
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.
Reply With Quote
  #11  
Old 02-09-2006, 11:54 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

I've attached a new version of the test script that generates colors based on the height.
Attached Files
File Type: zip testHeightField.zip (840 Bytes, 764 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:28 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC