<div dir="ltr">Dear Zhichao, <div><br></div><div>If you want to use VES data structures directly, that is possible. Look at the code below. But also, you can create VTK data structure on the FLY as well. Have a look at this simple line <br>
</div><div>example (<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/PolyLine">http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/PolyLine</a>). </div><div><br></div><div>Using VTK might be easier as it is high level vs in VES directly. However, it may be faster to create it in VES directly. </div>
<div><br></div><div>Hope this helps, </div><div>Aashish <br></div><div><br></div><div><div>vesGeometryData::Ptr geometryData (new vesGeometryData());</div><div> vesSourceDataP3N3C3f::Ptr sourceData(new vesSourceDataP3N3C3f());</div>
<div><br></div><div> vesVector4f topLeftColor = vesVector4f(1.0f, 0.0f, 0.0f, 1.0f);</div><div> vesVector4f bottomRightColor = vesVector4f(0.0f, 0.0f, 1.0f, 1.0f);</div><div> vesVector4f color = vesVector4f(0.0f, 1.0f, 0.0f, 1.0f);</div>
<div><br></div><div> // Points.</div><div> vesVertexDataP3N3C3f v1;</div><div> v1.m_position = vesVector3f(-1.0f, -1.0f, 0.0f);</div><div> v1.m_normal = vesVector3f(0.0f, 0.0f, 1.0f);</div><div> v1.m_color = vesVector3f(color[0], color[1], color[2]);</div>
<div><br></div><div> vesVertexDataP3N3C3f v2;</div><div> v2.m_position = vesVector3f(1.0f, -1.0f, 0.0f);</div><div> v2.m_normal = vesVector3f(0.0f, 0.0f, 1.0f);</div><div> v2.m_color = vesVector3f(bottomRightColor[0], bottomRightColor[1], bottomRightColor[2]);</div>
<div><br></div><div> vesVertexDataP3N3C3f v3;</div><div> v3.m_position = vesVector3f(1.0f, 1.0f, 0.0f);</div><div> v3.m_normal = vesVector3f(0.0f, 0.0f, 1.0f);</div><div> v3.m_color = vesVector3f(color[0], color[1], color[2]);</div>
<div><br></div><div> vesVertexDataP3N3C3f v4;</div><div> v4.m_position = vesVector3f(-1.0f, 1.0f, 0.0f);</div><div> v4.m_normal = vesVector3f(0.0f, 0.0f, 1.0f);</div><div> v4.m_color = vesVector3f(topLeftColor[0], topLeftColor[1], topLeftColor[2]);</div>
<div><br></div><div> sourceData->pushBack(v1);</div><div> sourceData->pushBack(v2);</div><div> sourceData->pushBack(v3);</div><div> sourceData->pushBack(v4);</div><div><br></div><div> // Triangle cells.</div>
<div> vesPrimitive::Ptr triangles (new vesPrimitive());</div><div> vesSharedPtr< vesIndices<unsigned short> > indices (new vesIndices<unsigned short>());</div><div> indices->pushBackIndices(0, 3, 2);</div>
<div> indices->pushBackIndices(1, 0, 2);</div><div> triangles->setVesIndices(indices);</div><div> triangles->setPrimitiveType(vesPrimitiveRenderType::Triangles);</div><div> triangles->setIndexCount(3);</div>
<div> triangles->setIndicesValueType(vesPrimitiveIndicesValueType::UnsignedShort);</div><div><br></div><div> geometryData->setName("PlaneGeometryData");</div><div> geometryData->addSource(sourceData);</div>
<div> geometryData->addPrimitive(triangles);</div><div> return geometryData;</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 11, 2014 at 11:50 AM, Zhichao Hong <span dir="ltr"><<a href="mailto:zhichao.hong@gmail.com" target="_blank">zhichao.hong@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am trying to prototype a 3D project on android and iOS related to some scientific visualization. It involves some matrix calculation to derive a 3D spherical geometric model. The software will draw the sphere with user provided input parameters. The sphere is generated on the fly and it cannot be loaded from a static file. In VTK, it is very simple to use the mapper and actors. How do I do it in VES?<div>
<br></div><div>Thanks for the follow up.</div></div><div class="gmail_extra"><br clear="all"><div>Zhichao Hong, CSDP<br><a href="mailto:zhichao.hong@computer.org" target="_blank">zhichao.hong@computer.org</a></div><div><div class="h5">
<br><br><div class="gmail_quote">On Fri, Apr 11, 2014 at 10:20 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Fri, Apr 11, 2014 at 11:15 AM, Zhichao Hong <span dir="ltr"><<a href="mailto:zhichao.hong@gmail.com" target="_blank">zhichao.hong@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have played with both KiwiSimple and KiwiViewer. But I am still looking for an iOS and/or Android example that can show how to make simpler task happen such as draw a sphere surface using ves directly. </div>
</blockquote><div><br></div></div><div>Do you mean VES rendering library and not via Kiwi? We have KiwiSimple in the source code that should help. </div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">The loadDataset is nice. However, it only supports loading the data from a file (vtk, stl, etc). Is there a way to draw a shape directly from the memory?</div></blockquote><div><br></div></div><div>We don't have a example for that but if you have a reader that can read from the memory, then I don't think that would be hard. What is your use case? </div>
<div><br></div><div>Thanks,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><div>
<br></div><div>Any hint will be appreciated!</div><div><br clear="all"><div>Zhichao Hong, CSDP<br><a href="mailto:zhichao.hong@computer.org" target="_blank">zhichao.hong@computer.org</a></div>
</div></div>
<br></div>_______________________________________________<br>
Ves mailing list<br>
<a href="mailto:Ves@public.kitware.com" target="_blank">Ves@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
</font></span></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a>
</div>