I use the following codes.<br><br>int v1,v2, v3;&nbsp; //* are the vertices of the n cubes i want to draw.<br>v1 = v2 = v3 = 0;<br>float x[8][3] = { {v1,v2,v3},&nbsp; {v1+1,v2,v3}, {v1+1,v2+1,v3},&nbsp; {v1,v2+1,v3}, {v1,v2,v3+1},&nbsp; {v1+1,v2,v3+1},&nbsp; {v1+1,v2+1,v3+1},&nbsp; {v1,v2+1,v3+1} };<br>
<br>vtkSmartPointer&lt;vtkPoints&gt; points = vtkSmartPointer&lt;vtkPoints&gt;::New();<br><br>for (int i = 0; i &lt; pointCloud.size(); i++)<br>{<br>&nbsp;&nbsp;&nbsp; points-&gt;InsertNextPoint(x[i]);<br>}<br><br>vtkSmartPointer&lt;vtkCubeSource&gt; cubeSource = vtkSmartPointer&lt;vtkCubeSource&gt;::New();<br>
cubeSource-&gt;GetOutput()-&gt;SetPoints(points);<br>//cubeSource-&gt;GetOutput()-&gt;Update();<br>cubeSource-&gt;Update();<br><br><div class="gmail_quote">在 2012年4月18日 下午9:50,Rong Xu <span dir="ltr">&lt;<a href="mailto:xurong1981@gmail.com">xurong1981@gmail.com</a>&gt;</span>写道:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote">在 2012年4月18日 下午9:46,Jothybasu Selvaraj <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>&gt;</span>写道:<div class="im">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Did you call cubeSource-&gt;Update() ?<br></div></blockquote></div><div><br>Yes, I have called cubeSource-&gt;Update().<br>&nbsp;</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr"><br>Jothy<br><br><div class="gmail_quote">2012/4/18 Rong Xu <span dir="ltr">&lt;<a href="mailto:xurong1981@gmail.com" target="_blank">xurong1981@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>
Dear David Doria :<br><br><div class="gmail_quote">2012/4/18 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div class="gmail_quote"><div>2012/4/18 Jothybasu Selvaraj <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">Look at this<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Cube" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Cube</a><br><br>SetDimesions and SetOrigin should do what you need.<br>





<br>Jothy<br></div></blockquote><div><br></div></div>Additionally, you can use the vtkCubeSource to setup the topology (connectivity), then use&nbsp;</div><div class="gmail_quote"><br></div><div class="gmail_quote">vtkPoints* points = vtkPoints::New();</div>




<div class="gmail_quote"><br></div><div class="gmail_quote">points-&gt;InsertNextPoint(x,y,z);</div><div class="gmail_quote">//&nbsp;...&nbsp;do this 8 times for your 8 points...</div><div class="gmail_quote"><br></div><div class="gmail_quote">




cubeSource-&gt;GetOutput()-&gt;SetPoints(points);</div></blockquote><div><br>Thank you for your help!<br><br>But I used &quot;cubeSource-&gt;GetOutput()-&gt;SetPoints(points);&quot; that you introduced, the cube created still has default attributes. Do you have any ideas ?<br>



&nbsp;</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><br></div><div class="gmail_quote">David<br></div>
</blockquote></div><br><br clear="all"><br>-- <br><br> ---------------------<br>Best Regards!<br><br>===============================================<br>Rong Xu,&nbsp; Ph.D Student<br>Ohya Lab<br>Graduate School of Global Information
and Telecommunication<br>Studies (GITS), Waseda University<br>1-6-1 Nishi Waseda, Shinjuku-ku,
Tokyo, Japan (〒169-8050)<br><br>Tel:&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="tel:%2B81-80-4208-1207" value="+818042081207" target="_blank">+81-80-4208-1207</a><br>E-mail:&nbsp; &nbsp;&nbsp; <a href="mailto:xurong1981@gmail.com" target="_blank">xurong1981@gmail.com</a><br>


&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <a href="mailto:xurong@fuji.waseda.jp" target="_blank">xurong@fuji.waseda.jp</a><br>
===============================================<br><br>
<br></div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</font></span></div>
</blockquote></div></div></div><div class="HOEnZb"><div class="h5"><br><br clear="all"><br>-- <br><br> ---------------------<br>Best Regards!<br><br>===============================================<br>Rong Xu,&nbsp; Ph.D Student<br>
Ohya Lab<br>Graduate School of Global Information
and Telecommunication<br>Studies (GITS), Waseda University<br>1-6-1 Nishi Waseda, Shinjuku-ku,
Tokyo, Japan (〒169-8050)<br><br>Tel:&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a href="tel:%2B81-80-4208-1207" value="+818042081207" target="_blank">+81-80-4208-1207</a><br>E-mail:&nbsp; &nbsp;&nbsp; <a href="mailto:xurong1981@gmail.com" target="_blank">xurong1981@gmail.com</a><br>
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <a href="mailto:xurong@fuji.waseda.jp" target="_blank">xurong@fuji.waseda.jp</a><br>
===============================================<br><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><br> ---------------------<br>Best Regards!<br><br>===============================================<br>Rong Xu,&nbsp; Ph.D Student<br>Ohya Lab<br>Graduate School of Global Information
and Telecommunication<br>Studies (GITS), Waseda University<br>1-6-1 Nishi Waseda, Shinjuku-ku,
Tokyo, Japan (〒169-8050)<br><br>Tel:&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; +81-80-4208-1207<br>E-mail:&nbsp; &nbsp;&nbsp; <a href="mailto:xurong1981@gmail.com" target="_blank">xurong1981@gmail.com</a><br>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <a href="mailto:xurong@fuji.waseda.jp" target="_blank">xurong@fuji.waseda.jp</a><br>
===============================================<br><br>