Imagination PowerVR SDK Blog

Load Multiple Meshes?


#1

Hello
I was wondering… is there any easy way of loading multiple meshes into a PVR scene?
Is there any method of doing it?
I am trying to load both an animated mesh (using matrix palettes) and a background 3d hutt and I am unable to see them both!..
Thanks alot



#2

If you are using 3DS MAX, or Maya, to create your scene, the easiest way to do this is to import all your meshes into one file. Then, use the PowerVR Exporter to export this scene to a POD file. You can now load this POD scene, containing multiple meshes, with the tools provided in the PowerVR SDK. The IntroducingPOD training course in the PowerVR SDK is an example of using multiple meshes from a POD scene. The Matrix Palette training course (OpenGLES1.x SDK) has three meshes, one of which uses skinning, which sounds like it might be similar to what you’re trying to do.

Stefan


#3

Yes, I know you can export multiple meshes into a single pod file, but I need to be able to load the meshes on demand.

I am trying to create a videogame, and It has no sense to load all of the enemies, structures, items, etc on a single file, that would exhaust the terminal’s memory

I found inside the demos section (“mouse” demo) a way to include the

meshes on demand using HeaderStruct_Mesh_Type objects, but the meshes I

import don’t animate at all.

No other way to load them?

Thanks


#4

When loading POD files, the whole scene is always loaded into memory.

You could export each individual object to a different POD file. Each object would be loaded as a separate SPODScene, which you could use as required in your game.

Stefan


#5

Yes, that’s what I thought to do in the first place, but if I try to load two Scenes, only the last one appears.

I use m_Scene.ReadFromFile(pFilename); to load the scene.

Maybe there is some other way to load the scene adding the elements? something like “AddFromFile”?

Thanks for your quick responses! :slight_smile:


#6

You should be able to load the required scenes, something like this:
m_Scene1.ReadFromFile(pFilename1);
m_Scene2.ReadFromFile(pFilename2);
Then at render time, draw meshes from m_Scene1, and draw meshes from m_Scene2.

There is no facility for adding the meshes from m_Scene2 into m_Scene1. Although, you could do it manually, if you needed too.

Stefan



#7

Hi there
I’ve tried to load both scenes into an array and update them separately, and it worked!
Now the only thing I need to do is tweak the frames animation in order to make each .pod follow its own frame number, but I think I will be able to manage it.

Thanks a’lot!



#8

The scene struct has multiple meshes. Add a node per mesh, and you can do multi instances with different materials, positioning scaling and rotation ( of same mesh).