Dead Mesh

Blitz3D Forums/Blitz3D Beginners Area/Dead Mesh

IKG(Posted 2006) [#1]
Whenever I load a mesh into the game, it places itself on the map before I set it's coordinates. Basically, it creates an extra dead mesh that does nothing. Even though I use the mesh (that I loaded) afterwards, I don't know how to get rid of the dead clone. Do you know what I'm talking about?


Matty(Posted 2006) [#2]
hide the mesh with hideentity


WolRon(Posted 2006) [#3]
FreeEntity


Andy(Posted 2006) [#4]
>Do you know what I'm talking about?

No!


Andy


Shambler(Posted 2006) [#5]
Not sure what you mean but are you using copyentity/mesh to position new clones and you then want to delete the original mesh?

If so use FreeEntity like Wolron said, if not then I don't know what you are talking about either ;)


IKG(Posted 2006) [#6]
Whenever I load a mesh, it's automatically placed/spawned. I then start using it for whatever purposes I need, but there's still the dead clone that spawned earlier. If you still don't know what I'm talking about, then thanks anyway.


jhocking(Posted 2006) [#7]
Could you post some code or something? It sounds like you are creating two meshes when you only want one.


IKG(Posted 2006) [#8]
It has happened in more than 1 program. I'll just mess around more and see if I can fix it. Seems like no one else has had this problem...

Update: I did some tests and found out it happens as soon as I first load the mesh.


WolRon(Posted 2006) [#9]
Post some code.


jfk EO-11110(Posted 2006) [#10]
When you load a mesh, it's positioned at coordinate 0,0,0 by default. There should be only ONE mesh, no clones. If there is more than one Mesh right after loading one mesh, then there's something wrong with your setup. I never heard of such a bug so far. I doubt it's your drivers, but you could try to update your graphics card drivers.

Make sure you are not cloning the mesh somewhere, eg. by using copymesh, copyentity, or by using LoadMEsh in a Loop, twice etc.

Make a simple failsafe miniapp like this:

graphics3d 640,480,32,2
setbuffer backbuffer()

camera=createcamera()
translateentity camera,0,0,-10

mesh=loadmesh("mymesh.3ds)

translateentity mesh,2,0,0

renderworld()
flip
waitkey()


Now, do you see one or two meshes?


IKG(Posted 2006) [#11]
I usually load a mesh and then position it somewhere with "PositionEntity". I'll try your code later JKF, when I have the chance. Thanks.

Update: I just relized something. This whole time I've been using "PositionEntity" to move mesh's and stuff around. Should I really be using "TranslateEntity"?


octothorpe(Posted 2006) [#12]
One is relative, the other absolute. Personal preference.


t3K|Mac(Posted 2006) [#13]
i am experiencing the same problem. i've added a hudcam, and now my code suffers from this "dead mesh" at 0,0,0.
i'll go deeper to find out why.


t3K|Mac(Posted 2006) [#14]
my solution for this problem:

hide hud-elements, disable hudcam, enable normalcam, renderworld
then hide level, show hud-elements, enable hudcam, disable normalcam, renderworld

then flip - et voila the "dead mesh" is gone.


jfk EO-11110(Posted 2006) [#15]
of course when you render with two cameras, you may get "dead" meshes, although I guess this has nothing to do with the mesh, but only with the camera.

having multiple cameras rednering the same CameraViewPort doesn't make much sense.

CameraProjMode is the official command to activate/deactivate cameras.


t3K|Mac(Posted 2006) [#16]
i did deactivate the camera, but i didn't hide the hud-elements for the first render pass.....


big10p(Posted 2006) [#17]
It's a pity Blitz3D doesn't have a CreateWorld() command so that we could place different objects in separate worlds, and render as required. It would save all this hide/show malarkey. :)