Problem with mesh

BlitzMax Forums/MiniB3D Module/Problem with mesh

siread(Posted 2007) [#1]
I friend of mine is creating football stadiums in SketchUp and exporting them as 3ds. I convert them to b3d with Unwrap, but when I put them into the game this happens...



The fence should be behind the stand. However, if I use the Blitz3D SDK with Max it appears fine...



How can I fix this?


siread(Posted 2007) [#2]
I've also tried the SketchUp to B3D exporter but it's still the same.

Also, if I remove the textures the models appear fine in miniB3D.


klepto2(Posted 2007) [#3]
hmm, seems to be some z-order problem.
Maybe you're able to send me the mesh with some sample code to
(BenniRoessig add gmx dot de). I will delete the mesh as soon as I hopefully have fixed the problem and I will not use/publish the mesh in some other way.
does the mesh use alpha textures?

cheers klepto2


simonh(Posted 2007) [#4]
Yeah my guess is that the textures use alpha is some way. Feel free to throw the model this way - si@...


siread(Posted 2007) [#5]
Aha! Yes, the seats were pngs with alpha. I swapped them out for jpegs and it works fine. Cheers guys. :D


siread(Posted 2007) [#6]
Incidentally, what would you suggest for displaying a crowd. I'm not looking for realism or detailed animation, just something simple but effective if poss.


klepto2(Posted 2007) [#7]
Maybe some masked sprites with an animated texture on it.
Also maybe you have to glue some together for minimizing the data flow to the graphicscard. Some kind of single-surface system with precalculated z-order could make it. Or manage the
sprites with a simple octree or the like.

At least you have to try to reach a minimum of data flow, eg take the FIFA series, the whole game will run suitable with low detailed or no crowd, but if you change it to high crowd the older computers have trouble with the performance.

A small idea, create sectors (maybe out of cubes and parent the sprites to them(the cubes alpha should 0.0. Then you could test if the cubes are in the Viewfrustum. If yes then show all sprites, if not hide them.


Wayne(Posted 2007) [#8]
I'm thinking animated masked texture as well. Gimp does a great job creating masked textures.


siread(Posted 2007) [#9]
Ok, I have some (very rough) animated textures that disappear when the camera is too far away. The sprites are parented to a flat mesh, as klepto suggests.



Couple of questions:

1. If the parent mesh is not drawn because it is out of view, do the sprites still get drawn off screen? From what you said Klepto, it seems I have to hide them manually, right?

2. How can I place my fan block on the stadium? There will be different stadiums of various sizes, so I need to somehow find the seating surface and attach my fans to them on the appropriate incline.

Any pointers muchly appreciated. :)


siread(Posted 2007) [#10]
This is my fan code so far.

http://www.newstarsoccer.com/download/misc/Fans.zip


simonh(Posted 2007) [#11]
That many separate sprites will be way too slow. You need to group lots of vertices together for faster rendering.

You can try your hand at a singe surface system, or create a long quad for each row, with a scaled, repeating crowd texture applied to it.

When it comes to culling, the parent-child relationship is not taken into consideration. Each entity is checked individualy.

What klepto suggested is doing an EntityInvIew check yourself on the box, and if it's not in view, hide it. Then the child sprites will automatically be hidden and not checked for culling.

As for placing your fan block, there's probably no easy way to automatically make it perfectly fit all your stadiums - you may have to do it manually via trial and error.