FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Vertex are stored where ?

2 posters

Go down

Vertex are stored where ? Empty Vertex are stored where ?

Post  goldfrapp0x0309 Sun Mar 15, 2009 9:33 pm

I need to modify the mesh's vertexes (coloring, order etc)... Does anyone know where they can be accessed ?


Thanks
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Sun Mar 15, 2009 11:22 pm

_SIO2object->buf = ( unsigned char * ) sio2MapBuffer( _SIO2object->vbo, GL_ARRAY_BUFFER );

// Mess around with the buffer here...

// When you're done...
_SIO2object->buf = ( unsigned char * ) sio2UnmapBuffer( GL_ARRAY_BUFFER );
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty Thanks !

Post  goldfrapp0x0309 Mon Mar 16, 2009 3:18 pm

Yippie !

So just to get to know vbo's: How are they used and implemented. (direct me to an article ?) Any docs or pointers to how SIO2 implements them.

sio2MapBuffer( _SIO2object->vbo, GL_ARRAY_BUFFER ); //This function requests the vertex buffer from the vbo (i presume)


I presume the engine stores more than just vertices in there (textures, normals etc )

Thanks
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Mon Mar 16, 2009 4:34 pm

Check the fileformat_specification.pdf in the /docs directory.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty VBOs

Post  goldfrapp0x0309 Tue Mar 17, 2009 7:50 pm

Sorry for the slowness but how do i access the vertices...

This is what i tried, but i guess i should be referring to vbo offsets... ? (help)
Code:

inmesh->buf = ( unsigned char * ) sio2MapBuffer( inmesh->vbo, GL_ARRAY_BUFFER );
   unsigned char* ptr = inmesh->buf;
   while(*ptr =! NULL)
   {
            ptr++;
            ......
   }
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Tue Mar 17, 2009 8:12 pm

Take a look at sio2PhysicAddRigidBody:


Code:



         unsigned int n_vert = sio2ObjectGetNumVert( tmp );
            
         btVector3 vert;
      
         btConvexHullShape *_btConvexHullShape = new btConvexHullShape();

         while( i != n_vert )
         {
            memcpy( &v, &tmp->buf[ i * 12 ], 12 );
            
            vert.setValue( v[ 0 ],
                       v[ 1 ],
                       v[ 2 ] );
            
            _btConvexHullShape->addPoint( vert );
         
            ++i;
         }

sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  goldfrapp0x0309 Wed Mar 18, 2009 12:09 am

I can't make modification directly to object->buf.... How do i resend back the data to opengl ?
Thanks
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Wed Mar 18, 2009 1:55 am

Just unmap the buffer Wink that's all the modifications will be taken in consideration... that's how the softbody implementation and animation system works Wink
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty Normals

Post  goldfrapp0x0309 Tue Mar 31, 2009 1:14 am

Back again, this time for normals:

How about for normals, couldn't find them for suzanne example (i'm probably searching wrong place)?

How are they organized in the vbo buffer ?

Whats the role of struct vertex group (purely material/texture?)?

Thanks
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Tue Mar 31, 2009 2:57 am

Make sure that you export them: NO on the exporter...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty ??

Post  goldfrapp0x0309 Tue Mar 31, 2009 4:26 pm

Ok,

Normals in the buf, are they triangle or vertex normals ?

Thanks
goldfrapp0x0309
goldfrapp0x0309

Posts : 43
Join date : 2009-02-28

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  sio2interactive Tue Mar 31, 2009 5:28 pm

You mean face normals or vertex normals? Well they are the exact same type of normals that you set in blender (solid or smooth = face or vertex). Check tutorial08, part of the sphere is vertex normals and the others are face normals...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Vertex are stored where ? Empty Re: Vertex are stored where ?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum