Lovox - Load and render voxels in Love2d
Re: Lovox - Load and render voxels in Love2d
This is amazing I would love to make an RTS with this aesthetic.
Re: Lovox - Load and render voxels in Love2d
Hey, I'm the guy who made Sprit3r, cool that you mentioned it. I was wondering, do you do any optimizations when it comes to rendering, or just drawing images on top of each other? I wrote a similar render system for my Ludum Dare game, and I found it to be fairly slow especially with love.js for the web. My solution was using spritebatches and only update them when the camera angle changed. I imagine it could be possible to optimize even further though.
Computer science student and part time game dev! Currently working on Depths of Limbo!
Check out the game website DepthsOfLimbo.com!
And my personal website with all my projects evgiz.net!
Check out the game website DepthsOfLimbo.com!
And my personal website with all my projects evgiz.net!
Re: Lovox - Load and render voxels in Love2d
Do it! I'd love to see what you come up with.SSG_DEV wrote:This is amazing I would love to make an RTS with this aesthetic.
I dont do any other optimizing except for the way you just described. (And only rendering objects that are in the camera's view in my LD game.)evgiz wrote:Hey, I'm the guy who made Sprit3r, cool that you mentioned it. I was wondering, do you do any optimizations when it comes to rendering, or just drawing images on top of each other? I wrote a similar render system for my Ludum Dare game, and I found it to be fairly slow especially with love.js for the web. My solution was using spritebatches and only update them when the camera angle changed. I imagine it could be possible to optimize even further though.
From my testing I was able to have atleast 1000 models on screen at good fps on my decent laptop.
Of course the results may vary with model size, you seem to be using bigger models?
On a side note; Im currently trying to make the Z-buffer work better. It fails in some situations.
I also got an idea to (majorly) optimize the image/func to model functions, which could make them very usuable in games without having a big performance impact.
Re: Lovox - Load and render voxels in Love2d
Hi, I realize this is an old post, but I would like to use this library for a game.
My question is how do you rotate the camera around a point, like seen in the second gif?
Other than that, awesome work man!
My question is how do you rotate the camera around a point, like seen in the second gif?
Other than that, awesome work man!
Re: Lovox - Load and render voxels in Love2d
Okay so I figured out my problem. By default it rotates around the camera's position. However, I was using another camera lib to handle camera movement (so I was using 2 cameras). That of course results in the camera rotating around 0,0.
But then I have another question:
How do you move the camera left and right, relative to the current rotation?
I've got forwards and backwards movement figured out like so:
Code: Select all
Camera:move(-(math.sin(Camera.rotation) * 200 * dt), -(math.cos(Camera.rotation) * 200 * dt)) -- Forwards
Camera:move(math.sin(Camera.rotation) * 200 * dt, math.cos(Camera.rotation) * 200 * dt) -- Backwards
Re: Lovox - Load and render voxels in Love2d
I figured it out... Sorry for just writing 3 posts to myself here haha.
The solution is to just add or subtract 90 degrees to the movement and you got it. I can't believe could't figure this out for so long I asked for help here.
So here's the result:
Code: Select all
Camera:move(-(math.sin(Camera.rotation) * 200 * dt), -(math.cos(Camera.rotation) * 200 * dt)) -- Forwards
Camera:move(math.sin(Camera.rotation) * 200 * dt, math.cos(Camera.rotation) * 200 * dt) -- Backwards
Camera:move(math.sin(Camera.rotation-math.pi/2) * 200 * dt, math.cos(Camera.rotation-math.pi/2) * 200 * dt) -- Left
Camera:move(math.sin(Camera.rotation+math.pi/2) * 200 * dt, math.cos(Camera.rotation+math.pi/2) * 200 * dt) --Right
Who is online
Users browsing this forum: No registered users and 2 guests