hkGeometry/hkMesh

hkGeometry/hkMesh

michael guerra's picture

hi,
Im was developed a mini-Graphics Engine, in the case of geometry rendering this use the hkGeometry to get the rigid body info respected to vertices and indices... but some in this was difficuting for me, i cant get the vertex normal and Texture Mappingfor diferernt graphics utilities may be rendering with lights etc... so how i can get these vertex normals in hkxMesh or in this same hkGeometry..

thanks...

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
havokcormac's picture

Hi Michael,

hkGeometry contains no info about vertex normals - it's just a list of points and a list of triangle indices into the points list.
It would be easy to calculate a normal for each face, but that's obviously not the same as a vertex normal.

hkxMesh contains a list of hkxMeshSections.
Each of those contains a hkxVertexBuffer.
The hkxVertexBuffer contains VertexData (arrays of hkVector4s, hkReals and some int types) and a hkxVertexDescription, as well as telling you the number of verts and the striding of the arrays.
The hkxVertexDescription tells you what each element of the hkxVertexBuffer's lists is for - whether it's the vertex position, normal, color, texture coordinate and so on.
So you'd have to write a utility to decode that info to get to the vertex normals.

However, hkxMesh is not intended for runtime display geometry.
The hkx* classes are part of the tool chain, but it's intended that game developers would export their display geometry from the modeller in other formats more suited to their runtime graphics engine.

That said, if you want to use it this way we won't try to stop you ;P

Cormac

Login to leave a comment.