<br><br><div class="gmail_quote">On Thu, Nov 4, 2010 at 5:15 PM, Joey Mukherjee <span dir="ltr">&lt;<a href="mailto:joeymu@gmail.com">joeymu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Now I remember why this doesn&#39;t work.  When you have a texture, it<br>
must just be a flat image, right?  You can&#39;t add any relief (i.e.<br>
vtkWarpScalar) to make it look different?  Passing the output of<br>
vtkWarpScalar doesn&#39;t seem to work.<br></blockquote><div><br></div><div>Correct,  a texture in general is a flat image. What you can do easily is to use two textures: </div><div><br></div><div>1. height map texture (for warping)</div>
<div>2. decal texture (for coloring). </div><div><br></div><div>Now not sure if you are familiar with shaders but what would I do is the pass these two the shader&#39;s and use height map texture to warp the globe geometry (move the vertices) </div>
<div>and other to color the fragments in the fragment shader.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Its amazingly fast to plot this data as a texture instead of trying to<br>
plot it as an image.<br>
<br>
Also, to get this to work, I had to make the lat/long range go from<br>
-180 to 180 and -90 to 90 since that is what my image is.  I realize<br>
in Donny&#39;s original example, he already had the USA image and just<br>
want to map that part.  I thought he was digging into a larger<br>
dataset.<br></blockquote><div> </div><div>So basically  you were using the entire globe right? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
If I just wanted to show a certain region specified by a given<br>
lat/long range, would any of the vtkGeo stuff be able to help me?  I&#39;m<br>
ideally interested in viewing the data at the polar regions.<br>
<br></blockquote><div>It should if not let me know. </div><div><br></div><div>Thanks,</div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thank you for this!<br>
Joey<br>
<br>
On Thu, Nov 4, 2010 at 10:57 AM, Aashish Chaudhary<br>
<div><div></div><div class="h5">&lt;<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Nov 4, 2010 at 11:51 AM, Joey Mukherjee &lt;<a href="mailto:joeymu@gmail.com">joeymu@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Nov 4, 2010 at 10:42 AM, Aashish Chaudhary<br>
&gt;&gt; &lt;<a href="mailto:aashish.chaudhary@kitware.com">aashish.chaudhary@kitware.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Nov 4, 2010 at 11:34 AM, Joey Mukherjee &lt;<a href="mailto:joeymu@gmail.com">joeymu@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks for posting this example Aashish!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I have some NetCDF data files that I would like to overlay over the<br>
&gt;&gt;&gt;&gt; Earth and be able to extract subsets from them and the like.  To get this<br>
&gt;&gt;&gt;&gt; same type of visualization, can I make use of the Geo classes?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Probably need more detail on exactly what you are trying to do but in<br>
&gt;&gt;&gt; general you should be able to use Geo*  classes for the purpose above.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Does the have to be a texture map or can I use any kind of regularized<br>
&gt;&gt;&gt;&gt; image data?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Can you elaborate this?<br>
&gt;&gt;<br>
&gt;&gt; I have some NetCDF files which are described as follows:<br>
&gt;&gt; netcdf test {<br>
&gt;&gt; dimensions:<br>
&gt;&gt;         x = 5760 ;<br>
&gt;&gt;         y = 2880 ;<br>
&gt;&gt; variables:<br>
&gt;&gt;         float x(x) ;<br>
&gt;&gt;                 x:long_name = &quot;x&quot; ;<br>
&gt;&gt;                 x:actual_range = 0., 360. ;<br>
&gt;&gt;         float y(y) ;<br>
&gt;&gt;                 y:long_name = &quot;y&quot; ;<br>
&gt;&gt;                 y:actual_range = -90., 90. ;<br>
&gt;&gt;         float z(y, x) ;<br>
&gt;&gt;                 z:long_name = &quot;z&quot; ;<br>
&gt;&gt;                 z:_FillValue = NaNf ;<br>
&gt;&gt;                 z:actual_range = -9.04707336425781, 10.6143484115601 ;<br>
&gt;&gt; // global attributes:<br>
&gt;&gt;                 :Conventions = &quot;COARDS/CF-1.0&quot; ;<br>
&gt;&gt;                 :GMT_version = &quot;4.3.1 [64-bit]&quot; ;<br>
&gt;&gt;                 :node_offset = 1 ;<br>
&gt;&gt; The X/Y are long/lat respectively, with the z being the scalar values.  I<br>
&gt;&gt; would like to overlay this file and others onto a globe and specify just<br>
&gt;&gt; portions of the map to view.  vtkNetCDFCFReader will output an image (I<br>
&gt;&gt; believe), but its the part of mapping it to the globe which gets me.  I<br>
&gt;&gt; can&#39;t just convert an image to a texture map, can I?<br>
&gt;<br>
&gt; Just like the example, you can use vtkTexture and call SetInput on it with<br>
&gt; the vtkImageData (that s the output of the image reader).<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; You can see that this is a pretty high resolution (5760x2880) dataset so<br>
&gt;&gt; I&#39;d like to just look at portions of the dataset to save time.<br>
&gt;<br>
&gt; Sure.<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Joey<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; | Aashish Chaudhary<br>
&gt; | R&amp;D Engineer<br>
&gt; | Kitware Inc.<br>
&gt; | <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>| Aashish Chaudhary <br>| R&amp;D Engineer         <br>| Kitware Inc.            <br>| <a href="http://www.kitware.com">www.kitware.com</a>    <br>