<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Verdana","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Please search the forum email archives this TOPIC has been
talked about 100’s of times <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>These shapes are not meant to be used as drawing and textured  shapes.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
7.5pt;font-family:"Courier New";color:#1F497D'>__________________________________________________________<br>
</span><i><span style='font-size:7.5pt;font-family:"Courier New";color:blue'>Gordon
Tomlinson </span></i><span style='font-size:7.5pt;font-family:"Courier New";
color:blue'><br>
<br>
</span><i><span style='font-size:7.5pt;font-family:"Courier New";color:#1F497D'><a
href="mailto:gordon@GordonTomlinson.com"><span style='color:blue'>gordon@GordonTomlinson.com</span></a></span></i><span
style='font-size:7.5pt;font-family:"Courier New";color:#1F497D'><br>
</span><span style='font-size:7.5pt;font-family:"Courier New";color:green'>IM</span><span
style='font-size:7.5pt;font-family:"Courier New";color:#1F497D'>: <i><a
href="mailto:gordon3dBrit@3dscenegraph.com"><span style='color:blue'>gordon3dBrit@3dscenegraph.com</span></a></i><br>
<i><a href="http://www.vis-sim.com/"><span style='color:blue'>www.vis-sim.com</span></a>
<a href="http://www.gordontomlinson.com/"><span style='color:blue'>www.gordontomlinson.com</span></a></i>
</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
7.5pt;font-family:"Courier New";color:#1F497D'>__________________________________________________________</span><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal align=left style='text-align:left'><b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
osg-users-bounces@lists.openscenegraph.org [mailto:osg-users-bounces@lists.openscenegraph.org]
<b>On Behalf Of </b>xuyuanzhen1<br>
<b>Sent:</b> Wednesday, September 10, 2008 12:48 AM<br>
<b>To:</b> OpenSceneGraph Users<br>
<b>Subject:</b> Re: [osg-users] Utility functions<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal align=left style='text-align:left'><o:p> </o:p></p>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>Hello all,</span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'> </span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>     
But how to take texture to this shapes?For example,I draw a cylinder by
following code:</span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>-------------------------------------------------------</span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>osg::ref_ptr
<osg::Cylinder > cylinder = new<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>osg::Cylinder(osg::Vec3f(), 2.0, 5.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>sd = new osg::ShapeDrawable(cylinder.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>geode-
>addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>-------------------------------------------------------<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>How I take texture to
only the top face not all faces?<o:p></o:p></span></p>

</div>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>Best Regards.</span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:silver'>2008-09-10 </span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:navy'>

<hr size=2 width=122 style='width:91.5pt' align=left>

</span></div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif";color:silver'>xuyuanzhen1 </span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:navy'>

<hr size=2 width="100%" align=center>

</span></div>

<div>

<p class=MsoNormal align=left style='text-align:left'><strong><span lang=ZH-CN
style='font-size:10.0pt;font-family:SimSun'>发件人:</span></strong><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> Vijay Patil <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><strong><span lang=ZH-CN
style='font-size:10.0pt;font-family:SimSun'>发送时间:</span></strong><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> 2008-09-10 
12:44:43 <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><strong><span lang=ZH-CN
style='font-size:10.0pt;font-family:SimSun'>收件人:</span></strong><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> OpenSceneGraph
Users <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><strong><span lang=ZH-CN
style='font-size:10.0pt;font-family:SimSun'>抄送:</span></strong><span
lang=ZH-CN style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><strong><span lang=ZH-CN
style='font-size:10.0pt;font-family:SimSun'>主题:</span></strong><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> Re: [osg-users]
Utility functions <o:p></o:p></span></p>

</div>

<div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>On Wed, Sep 10, 2008 at 8:16 AM, ami guru 
<dosto.walla@gmail.com > wrote:<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> Hello forum,<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> Are there any utility functions for drawing spheres, planes , boxes ,cubes<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> etc. within OSG's framework?<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> Sajjad<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> _______________________________________________<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> osg-users mailing list<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> osg-users@lists.openscenegraph.org<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>> <a
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>><o:p> </o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>To draw regular shapes in OSG, refer to classes derived to<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>'osg::Shape'. Following is a segment from a program while<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>experimenting with those classes.<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>Also to find out if a particular shape is implemented in OSG, I<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>usually refer to HTML documentation (Generated using Doxygen). Just<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>refer to all the classes.<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>----------------------------------<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr
<osg::MatrixTransform > draw_shape(std::string shape, float x)<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>{<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>/* Geode containing a shape. */<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Geode
> geode = new osg::Geode;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::ShapeDrawable
> sd;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>if(shape == "box") {<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Box
> box = new osg::Box(osg::Vec3f(), 5.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>sd = new osg::ShapeDrawable(box.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>geode- >addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>} else if(shape == "cylinder") {<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Cylinder
> cylinder = new<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::Cylinder(osg::Vec3f(), 2.0, 5.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>sd = new osg::ShapeDrawable(cylinder.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>geode- >addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>} else if(shape == "capsule") {<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Capsule
> capsule = new osg::Capsule(osg::Vec3f(), 2.0, 5.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>sd = new osg::ShapeDrawable(capsule.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>geode- >addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>} else if(shape == "cone") {<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Cone
> cone = new osg::Cone(osg::Vec3f(), 2.0, 5.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>sd = new osg::ShapeDrawable(cone.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>geode- >addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>} else if(shape == "sphere") {<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr <osg::Sphere
> sphere = new osg::Sphere(osg::Vec3f(), 2.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>sd = new osg::ShapeDrawable(sphere.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>geode- >addDrawable(sd.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>}<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>/* Use matrix tranform to place the object at desired position<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> * from origin. */<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::ref_ptr
<osg::MatrixTransform
> mtleft = new osg::MatrixTransform;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>mtleft-
>setDataVariance(osg::Object::STATIC);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg::Matrix m;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>m.makeTranslate(x, 0.0, 0.0);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>mtleft- >setMatrix(m);<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>/* Add geode to matrix transform object. */<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>mtleft- >addChild(geode.get());<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>return mtleft.get();<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>}<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>-- <o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>Vijay Patil<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>_______________________________________________<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg-users mailing list<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'>osg-users@lists.openscenegraph.org<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'><a
href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
10.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p>

</div>

</div>

</div>

</body>

</html>