[gameprogrammer] Re: Generating and rendering meshes

  • From: Vince <uberneen@xxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Thu, 27 Mar 2008 07:04:24 -0700 (PDT)

When it comes to geometry, normals, and UV
coordinates, I let blender do all the work.  It seems
to me that generating your meshes by hand would be a
long and brutal process.
I modified the .tri exporter that Raydium uses to spit
out approximately what I need, and then just make a
few manual adjustments to the file.  I'm in no way
familiar with python, but I'm sure it's trivial to
adjust the exporter to put the information I'm adding
by hand in manually.  The blender export script, an
example completed mesh, and the required classes can
be found here:
http://tyranny.ckt.net/tabasco/dev/

I'm using VBO's to render, so I use GLEW to wrangle
the appropriate extensions.  That also means that I'm
using three vertexes per triangle.

It sounds like we're working on similar things.  If
you'd like to see my complete framework, I'd be happy
to upload it.  It's nothing special, in fact it's
probably a little embarrassing, but it does contain
what I consider to be some pretty useful proofs of
concept. (Most recent branch has half-assed bullet
physics!)

Vince~

--- richard sabbarton <richard.sabbarton@xxxxxxxxx>
wrote:

> 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
> 
> 
> 



      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: