Imagination PowerVR SDK Blog

Reading vertex data from a SPODMesh object


#1

Hi,
I am trying to do some basic tests to optimize performance and I need to pre-process my meshes and change their vertex data in some way (for example the UV coords). I see that the SPODMesh structure holds the data as it is stored in the POD file, so cycling thought is not exactly an immediate thing.
Can I suggest to add helper methods to the mesh that expose the data in a more standard way? Something like float* GetUVArray() or something similar. These methods would then handle all the various optsions (strides, stripping, interleave, …) and the API for the developer would be more straightforward.
In the meantime if anybody has sample code to share for looping through all the UV coordinates of a mesh I’d apreciate it.
Thanks,

   Luca


#2

If I remember correctly, the internal format used in POD files  is pretty

much the same as the format used by the hardware itself.

 

In any case, take a look at this example ( in the SDK) :

Imagination TechnologiesPowerVR SDKOGLES-1.1_WINDOWS_PCEMULATION_2.03.23.1162DemosVaseOGLESOGLESVase.cpp

 

void OGLESVase::DrawReflectiveMesh(unsigned int ui32MeshID, PVRTMat4 *pNormalTx)