single surface entities?

Blitz3D Forums/Blitz3D Programming/single surface entities?

slenkar(Posted 2003) [#1]
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


Ross C(Posted 2003) [#2]
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. :)


Wiebo(Posted 2003) [#3]
I don't think that copyEntity only uses one surface.. I'm even quite sure it creates a new surface for each new mesh.


slenkar(Posted 2003) [#4]
Would it be possible to add them to the same surface if they move independently?


Ross C(Posted 2003) [#5]
I thought it did. Strange, there seems to be no difference between copyentity and copymesh then. I'm confused!


Rob(Posted 2003) [#6]
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.


Rob(Posted 2003) [#7]
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.


Ross C(Posted 2003) [#8]
Thanks for clearing that up :)


Gabriel(Posted 2003) [#9]
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.


Peer(Posted 2003) [#10]
look here
There is a function for it at the code Samples.