Hi Gerrit

Here is the code. I think there is some sort of coding mistake

NodeRefPtr cone = SceneFileHandler::the()->read(image);

Geometry* geo = (Geometry*)node->getCore();



if (geo == NULL) return 0;

GeoVectorPropertyRecPtr pos = geo->getPositions();

GeoIntegralPropertyUnrecPtr posIndex = 
geo->getIndex(Geometry::PositionsIndex);

if (pos == NULL || posIndex == NULL) return 0;

for (UInt32 i=0; i<pos->getSize(); ++i)

{

OSG::Pnt3f p;

pos->getValue(p, i);

// use this vertex here or push some where

}



for (UInt32 i=0; i<posIndex->getSize(); i+=3)

{


int value=0;

posIndex->getValue(value,i);

faces.push_back(value);

posIndex->getValue(value,i+1);

faces.push_back(value);

posIndex->getValue(value,i+2);

faces.push_back(value);


}

This psuecode for refereance.  Please tell me if i am doing anything wrong


----- Original Message ----- 
From: "Gerrit Voß" <[email protected]>
To: <[email protected]>
Sent: Friday, June 12, 2009 4:01 PM
Subject: Re: [Opensg-users] How to acccess indices in Geometry


>
> Hi,
>
> On Fri, 2009-06-12 at 13:05 +0530, alex wrote:
>> Hi
>>
>> How can i get list of indices in Geometry class.  ? I tried with this 
>> code
>> posIndex = geo->getIndex(Geometry::PositionsIndex);
>>
>> But it size doesnot matching with my loaded file. According to my .off 
>> file
>> it has 92 indices but in posIndex shows 290 indices in list.
>>
>
> hmm, do you have a sample file. As for your numbers, just to make sure
> 92 is really the amount of indices and not the amount of faces or
> vertices (e.g. not any of the number from the header section).
>
> The only good explanation would be that there is some kind of
> optimization running (e.g. striping) after the loading. This
> will change these numbers.
>
> kind regards,
>  gerrit
>
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
> 


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to