usage example :
void CViewRender::DrawAlienLens( IMaterialSystem * materials, IMaterial*
pMaterial )
{
materials->Bind( pMaterial );
AlienLens = materials->GetDynamicMesh( true );
CMeshBuilder meshBuilder;
meshBuilder.Begin( AlienLens, MATERIAL_TRIANGLES, 1512 );
meshBuilder.Position3f( 1.073661f, -1.167747f, 0.000000f );
meshBuilder.TexCoord2f( 0, 0.959300f, 0.999500f);
meshBuilder.AdvanceVertex();
meshBuilder.Position3f( 1.009307f, -1.167747f, 0.000000f );
meshBuilder.TexCoord2f( 0, 0.931700f, 0.999500f);
meshBuilder.AdvanceVertex();
... a ridiculous amount of similar calls here
meshBuilder.Position3f( -1.167747f, -1.167747f, -0.000000f );
meshBuilder.TexCoord2f( 0, 0.000500f, 0.999500f);
meshBuilder.AdvanceVertex();
meshBuilder.End();
AlienLens->Draw();
}
I wrote a text parser that takes an .smd, parses the triangles &
texcoords, and transforms them into this c++ code that I then just
copy/paste into my code :p
hth,
-- maarten
> Hi, I have questions about using the dynamic mesh
>
> 1. what should be the order of vertices in a triangle?
> 2. given three points, how to order them correctly (the fastest way)?
> 3. how do I calculate texture coordinates?
> 4. what is the least needed to draw a mesh (vertices are enough, or more
> is needed)?
> 5. how do I set the texture (is materials->bind(pMaterial) enough)?
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders