Hi guys,
I was wondering what is needed to give my meshes that "retro" look from old 3d games where everything was just done with wireframes.
I tried using this on one of those cubes you can get within Irrlicht:
cube->setMaterialFlag(EMF_WIREFRAME, true);
But it isn't cutting it. The wireframe shows the 2 triangles that form each cube face. What would I need to do to only show the faces (square ones) as wireframe?
Giving meshes that "retro" look
Giving meshes that "retro" look
OMG another MMORPG project! AztlanRPG
-
- Posts: 101
- Joined: Wed Dec 03, 2008 5:33 pm
- Location: ger
you could use a texture and draw every triangle of the mesh by calling
(don't know the exact syntax, sry for that)
in your main render loop after smgr->drawAll();
hope it helps.
(don't know the exact syntax, sry for that)
Code: Select all
core::triangle3df* tri = node->getTriangleSelector()->getTriangles();
//dont forget to set a material to driver with video::EMF_LIGHTING = false and the right transform state here
for(u32 i = 0; i < node->getTriangleSelector()->getTriangleCount () ; i++)
driver->drawTriangle3D(tri[i]);
hope it helps.
i love skateboarding!
EMF_WIREFRAME gives the same result.
but he wants
Code: Select all
+------+
|\ |
| \ |
| \ |
| \ |
| \ |
| \|
+------+
Code: Select all
+-------+
| |
| |
| |
| |
| |
| |
| |
+-------+
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
-
- Posts: 101
- Joined: Wed Dec 03, 2008 5:33 pm
- Location: ger
-
- Posts: 81
- Joined: Thu Oct 16, 2008 6:50 am
I think what you want is this :
This is a wireframe model of a building. It is not made up of triangles, but you need the 'outlines' of the various objects that define your model and this can achieved by defining the vertices of the objects. I use the following code :
(this is code from an application and is not supposed to be used 'as is'). The basic concept is to 'travel' around the edges of each face and add lines to a vertex buffer, which is then displayed using :
where pWireframe is a SMeshBuffer.
Maybe this might give you some ideas.
Anton
This is a wireframe model of a building. It is not made up of triangles, but you need the 'outlines' of the various objects that define your model and this can achieved by defining the vertices of the objects. I use the following code :
Code: Select all
void DCELFace::AddLine(HEDGEPTR E,SMeshBuffer *pBuffer,const vector3df &p1,const vector3df &p2)
{
long Size = pBuffer->Vertices.size();
S3DVertex vb;
if (Size + 2 < 65534L)
{
vb.Color = pBuffer->getMaterial().DiffuseColor;
vb.Pos = p1;
pBuffer->Vertices.push_back(vb);
pBuffer->BoundingBox.addInternalPoint(p1);
vb.Pos = p2;
pBuffer->Vertices.push_back(vb);
pBuffer->BoundingBox.addInternalPoint(p2);
}
}
void DCELFace::Wireframe(void)
{
SMeshBuffer *pW = (SMeshBuffer *) List->Wireframe->Buffer();
HEDGEPTR walkerE;
I3DPNT ws,w1,w2;
UINT i;
if (walkerE = edge)
{
bool start = true;
do
{
w2 = walkerE->origin->Vertex();
if (start)
{
ws = w2;
start = false;
}
else
AddLine(walkerE,pW,w1,w2);
w1 = w2;
walkerE = walkerE->next;
}
while (walkerE != edge);
AddLine(walkerE,pW,w2,ws);
}
if (Holes)
for (i = 0; i != Holes->size(); ++i)
Holes->at(i)->Wireframe();
}
Code: Select all
driver->drawVertexPrimitiveList(
pWireframe->getVertices(), pWireframe->getVertexCount(),
pWireframe->getIndices(), pFaceList->numLines,EVT_STANDARD, scene::EPT_LINES,EIT_16BIT);
Maybe this might give you some ideas.
Anton