OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Retrieve the triangles indices array from a geometry.


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Paradox
Appreciator


Joined: 19 Apr 2010
Posts: 133

PostPosted: Mon May 13, 2019 11:16 am    Post subject:
Retrieve the triangles indices array from a geometry.
Reply with quote

Hello,

I need to retrieve the triangles indices from a geometry.

I'm able to get all the verticies via getVertexArray() and then build an array that contains the getVertexArray() datas as list of scalars: [v1.x v1.y v1.z v2.x v2.y v2.z ... ]

I additionally need to build a bidimensional array that represent the interconnected coordinates like this:

static int gIndicesBunny[BUNNY_NUM_TRIANGLES][3] = {
{126, 134, 133},
{342, 138, 134},
{133, 134, 138},
{126, 342, 134},
{312, 316, 317},
...
...
}

where the triplet is the list of indices inside the array of scalars described above. So a triplet contains the indices of interconnected coordinates for a triangle.

How I can do that?

Here is attached the complete BunnyMesh.h example.

Thank you!

Cheers,
Dario
Back to top
View user's profile Send private message
Alberto Luaces
Guest





PostPosted: Mon May 13, 2019 4:07 pm    Post subject:
Retrieve the triangles indices array from a geometry.
Reply with quote

"Dario Minieri" writes:

Quote:
Hello,

I need to retrieve the triangles indices from a geometry.

I'm able to get all the verticies via getVertexArray() and then build an array that contains the getVertexArray() datas as list of scalars: [v1.x v1.y v1.z v2.x v2.y v2.z ... ]

Hi, Dario. The geometry holds one or more primitivesets, and each one
holds a pointer to the index list that you are looking for.

You can save your model into an .osg or .osgt file in order to inspect
the layout of the data and to better understand what is happening.

--
Alberto



------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How do I pass an array of structs to ... yjgao General [forum] 0 Fri Jun 28, 2019 9:25 am View latest post
No new posts How do I pass an array of structs to ... yjgao General [forum] 0 Fri Jun 28, 2019 9:24 am View latest post
No new posts Force OSG for GLES 2.0 to reenable ve... plamen_t General 4 Tue Jun 11, 2019 11:57 am View latest post
No new posts Layered rendering with a geometry shader AnyOldName3 General 8 Tue May 14, 2019 11:25 pm View latest post
No new posts hidden geometry in embedded osg Meldryt General 1 Thu Feb 21, 2019 7:17 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP