[gameprogrammer] Generating and rendering meshes
- From: "richard sabbarton" <richard.sabbarton@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Thu, 27 Mar 2008 11:54:03 +0000
Hi There,
I am looking to create a MESH loading and rendering class that I can
use to expand on the standard primitives normally available. I
haven't looked much at meshes before and I am making a few
assumptions...
- The mesh will form an array of vertex points
- The mesh will be defined by the width and height of the array
When I am rendering the mesh I will need to render two triangles for
each set of 4 vertices that make up that part of the mesh and then
loop through each segment. I am OK so far but I have some areas that
are a little unclear.
Each vertex should also have a Normal and a TextureCoord as well which
is not a problem. My question is, what is the best way of calculating
the Vertex Normals? I have already written code to calculate the
normal of a face but with per vertex normals the vertex will be part
of several faces with different normals. So how do I decide what the
normal should be for the vertex? My initial thought was to take an
average of all of the face normals that this vertex is part of and
then normalize the average but I was wondering if there is a specific
method that other 3D apps etc. would calculate these values.
Performance is not an issue because I will be precalculating the
norrmals at design time. I am just trying to determine which
direction to go...
Any thoughts?
Regards
Richard
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: Generating and rendering meshes
- From: Vince
- [gameprogrammer] Re: Generating and rendering meshes
- From: ®£$ǖ\"v@M$Ħ ¢© $.
Other related posts:
- » [gameprogrammer] Generating and rendering meshes
- » [gameprogrammer] Re: Generating and rendering meshes
- » [gameprogrammer] Re: Generating and rendering meshes
- » [gameprogrammer] Re: Generating and rendering meshes
- [gameprogrammer] Re: Generating and rendering meshes
- From: Vince
- [gameprogrammer] Re: Generating and rendering meshes
- From: ®£$ǖ\"v@M$Ħ ¢© $.