single surface entities?
Blitz3D Forums/Blitz3D Programming/single surface entities?
| ||
Hi I would like to create 100 entities that have the same mesh and texture and are all copies of the same entity. How would I put them on the same surface? They have to be able to move independently of each other. How would I do this? thanks |
| ||
You could use the copyentity command. That basically makes exact copies of the same mesh and puts them all on the same surface. Then you can do what you like with them, except apply new textures i think. But CopyEntity should work for what you want it to do. :) |
| ||
I don't think that copyEntity only uses one surface.. I'm even quite sure it creates a new surface for each new mesh. |
| ||
Would it be possible to add them to the same surface if they move independently? |
| ||
I thought it did. Strange, there seems to be no difference between copyentity and copymesh then. I'm confused! |
| ||
CopyEntity does not, nor does copymesh. To add something to an existing surface, simply copy the verts and triangles over - there's functions in code archives for this. If you think there will be a speed benefit from having a single surface mesh system, then you are quite wrong. The single surface approach only works up to a certain number of polygons. Once you go over that number, even moving one vertex will have a negative effect. It will be slower. Therefore Single Surface schemes are best left for static geometry or particle systems. |
| ||
CopyEntity will copy the entity including it's various properties - it should really be called CloneEntity because it doesn't take any more memory and will alter when the original is altered. CopyMesh will make an entirely new mesh without dependencies. Both will mean new surfaces at renderworld. |
| ||
Thanks for clearing that up :) |
| ||
If you think there will be a speed benefit from having a single surface mesh system, then you are quite wrong. The single surface approach only works up to a certain number of polygons. Once you go over that number, even moving one vertex will have a negative effect. It will be slower. I've not found that to be the case. And I've tested up to the maximum number of vertices possible on a surface. Granted it was only about double speed on a lot of vdeocards, but double speed is still worth doing, i think. |
| ||
look here There is a function for it at the code Samples. |