Hi Christian,

you may want to check the type of the primitive, I guess this is a 
tristrip of length 4 which equals 2 triangles. All the makeXXX 
Functions create optimized geometry.

Regards

Matthias

On Monday 18 April 2005 10:59, Christian Lessig wrote:
> Hi,
>
> I've got a question on geometry indexing in OpenSG. Here a small
> example:
>
> OSG::NodePtr scene = OSG::makePlane( 1.0, 1.0, 1, 1);
> assert( OSG::NullFC != scene);
>
> OSG::GeometryPtr geo = OSG::GeometryPtr::dcast( scene->getCore());
> assert( OSG::NullFC != geo);
>
> // preprocess geometry
> OSG::separateProperties( geo);
> OSG::createSingleIndex( geo);
>
> ...
>
> // OSG::calcPrimitveCount states that there are two triangles (as
> expected)
>
> ...
>
> // check indices
> OSG::GeoIndicesUI32Ptr fc_indices = OSG::GeoIndicesUI32Ptr::dcast(
> geo->getIndices());
> OSG::GeoIndicesUI32::StoredFieldType  indices =
> fc_indices->getField();
>
> for( unsigned int i=0; i<indices.size(); ++i) {
>
>   std::cout << "[" << i << "] = " << indices[i] << '\n';
> }
>
> I would expect to get a list similar to this:
>
> [0] = 0
> [1] = 1
> [2] = 2
> [0] = 0
> [1] = 2
> [2] = 3
>
> What I get is:
>
> [0] = 0
> [1] = 1
> [2] = 2
> [3] = 3
>
> I expected that there should be 6 indices for rendering two
> triangles? How does OpenSG handles indices here?
>
> Thanks,
> Christian
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
> users. Discover which products truly live up to the hype. Start
> reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to