I am trying to make 3d game like wolfenstein 3d. Now i am making prototype and have some problems. never working with 3d before, so some question can be stupid
1)I spawn a lot of models(wall) and get:
Model could not be created since the buffer is full (128)
Can i change model buffer size?
2)Is it bad for perfomance to spawn all models for level? I have raycasting and can spawn only visible models, but it need additional work.
3)I am using 3d camera. What is camera width and camera height? Is it 1x1?
4)I have some artifact with wall. See video and screenshot. What is it and how it can be fixed?
One more stupid question
The world is in 3d.
I am trying to add ‘sprites’ to world. That is not real sprite it game object with model and script.
script rotate go:
function update(self, dt)
go.set(".","euler.y",player.rot * 57.2958)
end
model contains texture with alpha.
All work correct but sometimes alpha on model is broken.Why this can happened?
Test wrapping rotation between 180 and -180 to see if it solves euler angle problems? If you put this project on github I’ll tinker and maybe contribute some improvements.
-- Wrap an angle between -180 and +180
function wrap_angle(angle)
if angle > 180 then
angle = M.wrap_angle(angle - 360)
elseif angle < -180 then
angle = M.wrap_angle(angle + 360)
end
return angle
end
I guess that’s z-buffer or stencil buffer random glitch. Maybe if you tinker around your render script you can find the problem. That’s definitely not texture being black instead of transparent. That’s the ground not being rendered behind the sprite.
Check that sprite can be hid by a corner of a wall. That is it’s not just drawn over the walls all the time.
If I was making it, I’d really make walls and the sprites the same objects, and just call them model_pred.
The prototype of game was done. You can move in 3d world, and shoot defold logo.
The next week i will be focused on game concept.
I want make o rogue like game in space setting with guns,robots, and psionic. Something like one more dungeon but in space. html demo