It looks like the voxel is included, but all color values are set to 0 in the texture which is why I couldn't see itkikito wrote:It's probably that my parser has a bug. I'll give it a look, thanks!
Sprit3r - 3D model viewer for spritesheets
Re: Sprit3r - 3D model viewer for spritesheets
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: Sprit3r - 3D model viewer for spritesheets
Does löve have 3d texture support? Which formats can do that?evgiz wrote:I don't know enough about shaders to do this myself, but I look forward to seeing what you can come up with!
If it does the rendering should be rather straightforward, the only thing I'm not sure how to do is casting a ray into the 3d texture to find the first pixel hit (and doing it better than just looping over it).
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Sprit3r - 3D model viewer for spritesheets
Hi, I am having trouble reproducing this. Can you pass me your current code + the vox model that you are using for tests?evgiz wrote:It looks like the voxel is included, but all color values are set to 0 in the texture which is why I couldn't see itkikito wrote:It's probably that my parser has a bug. I'll give it a look, thanks!
When I write def I mean function.
Re: Sprit3r - 3D model viewer for spritesheets
Yeah of course. Here is a love file, just click the example button and it'll load up example.voxkikito wrote: Hi, I am having trouble reproducing this. Can you pass me your current code + the vox model that you are using for tests?
As you can see on the bottom spritesheet there's a black pixel on the cyan circle, the last voxel I placed.
The code is pretty much the same as the one in your example, but tweaked to flip the model (it was upside down) as well as rendering any pixels with 0 alpha at 255 alpha so you can actually see them.
EDIT: Solved it! I changed this line in vox_model:readChar from self.str:len() to self.str:len()+1
Code: Select all
if self.index > self.str:len()+1 then return 0 end
Last edited by evgiz on Thu Nov 03, 2016 11:20 pm, edited 3 times in total.
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: Sprit3r - 3D model viewer for spritesheets
Hey,
Your post inspired me to mess around with the same concept of 2d sprites to 3d display.
So far I've got "models" as well as animations working with a simple camera, but there's one thing I'm still missing...
In your application you can switch between "flat" and "voxel" mode.
How did you achieve the "voxel" mode? I've looked trough your code, but can't figure it out.
Thanks in advance!
Your post inspired me to mess around with the same concept of 2d sprites to 3d display.
So far I've got "models" as well as animations working with a simple camera, but there's one thing I'm still missing...
In your application you can switch between "flat" and "voxel" mode.
How did you achieve the "voxel" mode? I've looked trough your code, but can't figure it out.
Thanks in advance!
Re: Sprit3r - 3D model viewer for spritesheets
To render voxels I simply draw each layer multiple times depending on the zoom and model scale so that they cover every pixel inbetween. This is veeery inefficient, but works fine for a single model. If you're planning on making a game I'd recommend finding an approach with better performance, for instance by pre rendering at set angles, clever spritebatching or something else.Tjakka5 wrote:In your application you can switch between "flat" and "voxel" mode.
How did you achieve the "voxel" mode? I've looked trough your code, but can't figure it out.
Thanks in advance!
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: Sprit3r - 3D model viewer for spritesheets
Oh just by the way - i had also seen the reddit post and tried around with the concept for a little, but I got sidetracked and made this animation:
the way it is rendered is the same except that the rotation is different between the layers most of the time, and the layer density is animated. Sprites could simply be substituted for the rectangles though.
and since apparently noone linked the thread, here is the original one on reddit with links to explanation videos and the games.
the way it is rendered is the same except that the rotation is different between the layers most of the time, and the layer density is animated. Sprites could simply be substituted for the rectangles though.
and since apparently noone linked the thread, here is the original one on reddit with links to explanation videos and the games.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Sprit3r - 3D model viewer for spritesheets
It was an off-by-one indexing error; the code assumed that the array was zero-based (0 to length-1), but apparently, it's one-based (1 to length)evgiz wrote:I'm not exactly sure what it does, but it seems to work... Thanks for all your help!
Interestingly, it should have also ignored the 0th (or, first) value before, as well, not just the last... i think.
In any case, i löve this project! Hope it keeps being relevant
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Sprit3r - 3D model viewer for spritesheets
The Sprit3r idea is very great. Way to go!
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Re: Sprit3r - 3D model viewer for spritesheets
I love it! You should put it on Github if it isn't already
Who is online
Users browsing this forum: No registered users and 1 guest