Creating custom mesh in 2.1
-
- Gnoblar
- Posts: 18
- Joined: Thu Sep 25, 2014 12:53 pm
Creating custom mesh in 2.1
Hello everyone ,
I know how to create custom mesh in 1.8,1.9 using manualobject and stuff but i have no clue when it comes to 2.1 ? any good ideas where to start. Trying to make small voxel world .
Regards Ashley
I know how to create custom mesh in 1.8,1.9 using manualobject and stuff but i have no clue when it comes to 2.1 ? any good ideas where to start. Trying to make small voxel world .
Regards Ashley
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: Creating custom mesh in 2.1
See CustomRenderable & DynamicGeometry samples.
There is also a community-ported version of ManualObject, but it works a little different (see http://www.ogre3d.org/forums/viewtopic. ... ct#p519713) and CustomRenderable probably has what you need.
There is also a community-ported version of ManualObject, but it works a little different (see http://www.ogre3d.org/forums/viewtopic. ... ct#p519713) and CustomRenderable probably has what you need.
-
- Gnoblar
- Posts: 18
- Joined: Thu Sep 25, 2014 12:53 pm
Re: Creating custom mesh in 2.1
Thank you for your reply . I checked the samples but couldnt find these two ? is it in the 2.1 - samples file ?dark_sylinc wrote:See CustomRenderable & DynamicGeometry samples.
There is also a community-ported version of ManualObject, but it works a little different (see http://www.ogre3d.org/forums/viewtopic. ... ct#p519713) and CustomRenderable probably has what you need.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
-
- Gnoblar
- Posts: 18
- Joined: Thu Sep 25, 2014 12:53 pm
Re: Creating custom mesh in 2.1
unchecked it by mistake . what is the difference between customrenderable and dynamicgeometry ?dark_sylinc wrote:Yes.
CustomRenderable, DynamicGeometry
Maybe you didn't enable OGRE_BUILD_SAMPLES2?
Cheers.
Matias.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: Creating custom mesh in 2.1
DynamicGeometry sample shows how to construct a v2 Mesh and create an Item from it, while still being able to modify the mesh after the Item was created (unless the buffers were created with the immutable flag for performance).
Decreasing the vertex/count afterwards is easy, but increasing the vertex/index count is almost impossible with this method unless you recreate the items or update its inner structure (though if you know the upper limit, you can create a vertex buffer large enough, then only use a fraction by calling VertexArrayObject::setPrimitiveRange)
CustomRenderable shows how to derive from MovableObject & Renderable to render geometry in a more customized way, similar to what deriving from v1::SimpleRenderable used to provide.
Decreasing the vertex/count afterwards is easy, but increasing the vertex/index count is almost impossible with this method unless you recreate the items or update its inner structure (though if you know the upper limit, you can create a vertex buffer large enough, then only use a fraction by calling VertexArrayObject::setPrimitiveRange)
CustomRenderable shows how to derive from MovableObject & Renderable to render geometry in a more customized way, similar to what deriving from v1::SimpleRenderable used to provide.
-
- Gnoblar
- Posts: 18
- Joined: Thu Sep 25, 2014 12:53 pm
Re: Creating custom mesh in 2.1
Thank you very much for your help. If i wanted to add uv for texturing . how would i go about ?dark_sylinc wrote:DynamicGeometry sample shows how to construct a v2 Mesh and create an Item from it, while still being able to modify the mesh after the Item was created (unless the buffers were created with the immutable flag for performance).
Decreasing the vertex/count afterwards is easy, but increasing the vertex/index count is almost impossible with this method unless you recreate the items or update its inner structure (though if you know the upper limit, you can create a vertex buffer large enough, then only use a fraction by calling VertexArrayObject::setPrimitiveRange)
CustomRenderable shows how to derive from MovableObject & Renderable to render geometry in a more customized way, similar to what deriving from v1::SimpleRenderable used to provide.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: Creating custom mesh in 2.1
Just add an extra element:
Code: Select all
vertexElements.push_back( VertexElement2( VET_FLOAT2, VES_TEXTURE_COORDINATES) );
-
- OGRE Expert User
- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 168
Re: Creating custom mesh in 2.1
maybe this thread could help you:
http://www.ogre3d.org/forums/viewtopic.php?f=25&t=83999
the uv part is commented out but its there
http://www.ogre3d.org/forums/viewtopic.php?f=25&t=83999
the uv part is commented out but its there