Vertex are stored where ?
2 posters
Vertex are stored where ?
I need to modify the mesh's vertexes (coloring, order etc)... Does anyone know where they can be accessed ?
Thanks
Thanks
goldfrapp0x0309- Posts : 43
Join date : 2009-02-28
Re: Vertex are stored where ?
_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 );
// Mess around with the buffer here...
// When you're done...
_SIO2object->buf = ( unsigned char * ) sio2UnmapBuffer( GL_ARRAY_BUFFER );
Thanks !
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
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- Posts : 43
Join date : 2009-02-28
VBOs
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)
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- Posts : 43
Join date : 2009-02-28
Re: Vertex are stored where ?
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;
}
Re: Vertex are stored where ?
I can't make modification directly to object->buf.... How do i resend back the data to opengl ?
Thanks
Thanks
goldfrapp0x0309- Posts : 43
Join date : 2009-02-28
Re: Vertex are stored where ?
Just unmap the buffer that's all the modifications will be taken in consideration... that's how the softbody implementation and animation system works
Normals
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
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- Posts : 43
Join date : 2009-02-28
??
Ok,
Normals in the buf, are they triangle or vertex normals ?
Thanks
Normals in the buf, are they triangle or vertex normals ?
Thanks
goldfrapp0x0309- Posts : 43
Join date : 2009-02-28
Re: Vertex are stored where ?
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...
Similar topics
» 2d Vertex Groups
» How many vertex groups is possible in sio2?
» An other vertex Group Question
» Vertex Coloring Script
» Vertex group problems
» How many vertex groups is possible in sio2?
» An other vertex Group Question
» Vertex Coloring Script
» Vertex group problems
Permissions in this forum:
You cannot reply to topics in this forum