Game Development Community

Draw Scaled flipped normals for cartoon outline?

by kingkong · in Torque Game Engine · 10/22/2006 (6:30 pm) · 3 replies

I saw "Cell Shading Tutorial" thread.
i tried it with 3dsmax and i works well.
the outline looks much better than drawing edges for outline.

instead of making model with scaled fliped normals,
i want to modify engine to draw mesh with scaled and flipped normals.

void TSMesh::render(S32 frame, S32 matFrame, TSMaterialList * materials, const MatrixF *objectTransform)
{
// draw normals

// draw scaled flipped normals with black color

}

how can i draw scaled flipped normals with black color for outline??
i don't know opengl, yet.
please, any advice!

thanks.

#1
10/22/2006 (9:55 pm)
You need to learn OpenGL :-)

First, turn off texturing and lighting. Then, set the vertex color to all black. Then, change glCullMode from CCW to CW (or is it the other way around? I forget). Then either bind a shader that moves the geometry based on the normal, or do a software transform on the vertex array to move the vertices out. Then draw that.

Then set all the state back again.
#2
10/23/2006 (9:51 pm)
Thanks for your answer.

i'm learning and it takes time. until then, i need somebody's help.

anybody did this before??
#3
10/24/2006 (1:07 am)
Yes, do a search.