I'm trying to put my gun at entityorder -100, but since the gun is made of several "elements" all collapsed into one mesh, it's drawing the individual components of the gun in the wrong order, but in front of everything else. Any suggestions?
EntityOrder help
Blitz3D Forums/Blitz3D Beginners Area/EntityOrder help Use multiple renders instead.
ShowEntity world
HideEntity gun
RenderWorld
ShowEntity gun
HideEntity world
Renderworld
ShowEntity world
HideEntity gun
RenderWorld
ShowEntity gun
HideEntity world
Renderworld
that's the only fix?? It seems kind of slow.
Wouldn't call it a 'fix' since nothings broken. Its more of a solution.
You're rendering the scene in two stages instead of just one - you're not rendering anything more than once. Its no slower than rendering everything in one go.
You're rendering the scene in two stages instead of just one - you're not rendering anything more than once. Its no slower than rendering everything in one go.
but the world involves TONS of entities, so it'd take forever to do that.
code please...maybe I can help...
pretty much it's just:
gun = loadmesh("...")
EntityOrder gun, -100
(it's kinda a complex file network, so putting it up would take forever)
gun = loadmesh("...")
EntityOrder gun, -100
(it's kinda a complex file network, so putting it up would take forever)
Did you try setting it to 0 to be drawn with everything else? Z-buffering could be a problem(it says non 0 is only for skyboxes/terrain.)
You could attach every object to a main pivot, and hide/show that pivot. But you could also use a 2nd camera:
Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;create normal cam cam = CreateCamera() ;create gun gun = CreateCube(cam) EntityColor gun, 255, 0, 0 ;create second camera cam2 = CreateCamera(gun) ;set cls mode to cls_zbuffer only CameraClsMode cam2, False, True ;move camera back a bit MoveEntity cam2, 0, 3, -3 ;position gun far away PositionEntity gun, -26000,-26000,-26000 ;create scenery For i = 0 To 1000 c = CreateCube() EntityColor c, 0, Rand(0,255),Rand(0,128) PositionEntity c, Rnd(-100,100), Rnd(-100,100),Rnd(-100,100) Next Repeat If KeyDown(203) TurnEntity cam,0,1,0 If KeyDown(205) TurnEntity cam,0,-1,0 If KeyDown(200) MoveEntity cam,0,0,1 If KeyDown(208) MoveEntity cam,0,0,-1 RenderWorld() Flip Until KeyHit(1) End
i think i'll just make the collision sphere around the player bigger, less of a hassle :)