April 25, 2024, 05:09:34 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Is there a way of transforming individual vertices of a 3DSprite?

Started by Kale, November 08, 2006, 03:46:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kale

Is there a way of transforming individual vertices of a 3DSprite?

I'm assuming that these types of sprite differ from the 2D version by these being little planes(?) with a texture mapped. If so is there a way of moving each individual vertex of the 3D plane?

Kind of like this:
http://www.purearea.net/pb/english/manual/sprite3d/transformsprite3d.html

Ionic Wind Support Team

I would have to look into it.  The 3D sprites are created using the DirectX9 ID3DXSprite interface which allocates an index buffer of 24576 indices (enough for 4096 triangles).  It only uses a single interface for all sprites so each texture loaded ends up referenced by those buffers.  ID3DXSprite uses a single DrawIndexedPrimitive() call flushed to the device to draw all sprites at once.

Internally it is probably storing each sprites reference to those buffers, but there doesn't seem to be a way to get at that particualr data.  So without know what triangles in the buffers reference a particular sprite it would be hard to modify them.

You're probably better off just creating a textured quad yourself if you want such transformations. 

Paul.
Ionic Wind Support Team

Kale

Quote from: Paul Turley on November 08, 2006, 05:37:02 AM
You're probably better off just creating a textured quad yourself if you want such transformations.

Using '3DMesh.CreateMesh()'?

Ionic Wind Support Team

Yes.  See custom_mesh.src in your d3d example folder.

Or use the CreateRectangle method which was designed for just such a thing.  It creates a 1x1 quad using two triangles that can be scaled using the Scale method. 

Ionic Wind Support Team