Sprit3r - 3D model viewer for spritesheets

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
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

Post by kikito »

evgiz wrote:
kikito wrote:
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
Emm... are you sure that's the only change you did? I have tried that and it gives me a bad result with your code. Can you upload the version which works fine?
When I write def I mean function.
User avatar
evgiz
Citizen
Posts: 83
Joined: Mon Aug 29, 2016 11:05 pm
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by evgiz »

That animated purple cube is amazing, it looks very "organic" if that makes any sense. Might have to play around with that :P
I'll see if I can get the project on github soon too!
kikito wrote:Emm... are you sure that's the only change you did? I have tried that and it gives me a bad result with your code. Can you upload the version which works fine?
Check out the .love in my original post, its the updated version. Im pretty sure I only changed that line in vox_model and another line in vox_texture (to flip the image), could be wrong tho... But anyways I got it to work so no need to take any more of your time :)
Computer science student and part time game dev! Currently working on Depths of Limbo! :cool:

Check out the game website DepthsOfLimbo.com! :ultrahappy:
And my personal website with all my projects evgiz.net! :megagrin:
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by s-ol »

evgiz wrote:That animated purple cube is amazing, it looks very "organic" if that makes any sense. Might have to play around with that :P
I'll see if I can get the project on github soon too!
kikito wrote:Emm... are you sure that's the only change you did? I have tried that and it gives me a bad result with your code. Can you upload the version which works fine?
Check out the .love in my original post, its the updated version. Im pretty sure I only changed that line in vox_model and another line in vox_texture (to flip the image), could be wrong tho... But anyways I got it to work so no need to take any more of your time :)
the code is very simple, but in moonscript: https://github.com/s-ol/demoloops/blob/ ... d.moon#L31

converted to Lua:

Code: Select all

      local width, height = lg.getDimensions()
      love.graphics.translate(width / 2, height / 2 + 70)
      
      local function draw(i)
        love.graphics.push()
        love.graphics.translate(0, -120 * i)
        love.graphics.scale(1, 0.5) -- perspective shortening
        love.graphics.scale(1 - 0.1 * math.sin(self.time + i * 2)) -- pyramid/bulge effect
        love.graphics.scale(0.8 - i * .4 * math.cos(self.time)) -- global zoom
        love.graphics.rotate(self.time / 4) -- global rotation
        love.graphics.rotate(i * .6 * math.cos(self.time)) -- skewing
        love.graphics.setColor(self.shades[i])
        love.graphics.rectangle("fill", -80, -80, 160, 160)
        return love.graphics.pop()
      end
      
      for i = 0, 1, 1 / (20 + 19 * math.sin(self.time / 2)) do
        draw(i) -- this does all the 'stacking' magic
      end
      draw(1)
time is just incremented by dt every update and loops after 4*math.pi (two full rotations in seconds).

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
evgiz
Citizen
Posts: 83
Joined: Mon Aug 29, 2016 11:05 pm
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by evgiz »

s-ol wrote: the code is very simple, but in moonscript: https://github.com/s-ol/demoloops/blob/ ... d.moon#L31
Impressive result in such a few lines of code!
Ulydev wrote:I love it! You should put it on Github if it isn't already :)
Here it is! https://github.com/evgiz/sprit3r
Computer science student and part time game dev! Currently working on Depths of Limbo! :cool:

Check out the game website DepthsOfLimbo.com! :ultrahappy:
And my personal website with all my projects evgiz.net! :megagrin:
User avatar
thatcosmonaut
Prole
Posts: 9
Joined: Sun Nov 06, 2016 6:04 pm

Re: Sprit3r - 3D model viewer for spritesheets

Post by thatcosmonaut »

this tool looks amazing, about to play around with it now.

If you wouldn't mind, could you add a license to the github repository? If you don't know which one to choose this site helps you decide: http://choosealicense.com/
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by zorg »

thatcosmonaut wrote:this tool looks amazing, about to play around with it now.

If you wouldn't mind, could you add a license to the github repository? If you don't know which one to choose this site helps you decide: http://choosealicense.com/
That site's missing the best license of them all :P :3
Me and my stuff :3True 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.
User avatar
evgiz
Citizen
Posts: 83
Joined: Mon Aug 29, 2016 11:05 pm
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by evgiz »

It's my first time using github for my own project, so I overlooked the need for a license. I've added the MIT one now, thanks for the heads up!
Computer science student and part time game dev! Currently working on Depths of Limbo! :cool:

Check out the game website DepthsOfLimbo.com! :ultrahappy:
And my personal website with all my projects evgiz.net! :megagrin:
User avatar
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

Post by kikito »

I was still finding some weird stuff so I have done more tests and found an error: in the generation of the texture, point coordinates need to be offset by 0.5 on the x and y coordinates in order to be precise. Otherwise, pixels might be drawn at the wrong coordinates.

I sent a pull request on Github.
When I write def I mean function.
User avatar
raingloom
Prole
Posts: 36
Joined: Wed Apr 22, 2015 12:35 am
Location: Always elsewhere

Re: Sprit3r - 3D model viewer for spritesheets

Post by raingloom »

Since I'm not a pixel artist but wanted to try it, I kinda messed up and noticed two bugs in the process:
  • single frames mess it up, the UI still works but only the menu button has an effect and loading doesn't work either, also, the layer distance gets set to infinity (this is why one should always consider edge cases, someone (me) will be stupid enough to try them)
  • it can only handle frames in rows, not in columns (the editor i used defaulted to the latter)
I'll send them as issues on GH
User avatar
evgiz
Citizen
Posts: 83
Joined: Mon Aug 29, 2016 11:05 pm
Contact:

Re: Sprit3r - 3D model viewer for spritesheets

Post by evgiz »

raingloom wrote: Single frames mess it up, the UI still works but only the menu button has an effect and loading doesn't work either, also, the layer distance gets set to infinity (this is why one should always consider edge cases, someone (me) will be stupid enough to try them)
Not sure I understand exactly what you mean by this. If there's only one layer? Like a square image? Should probably be an easy fix.
raingloom wrote: It can only handle frames in rows, not in columns (the editor i used defaulted to the latter)
This was intentional, but I can see how its kinda limiting. It'd be preferable to have a choice here (perhaps even selecting tiles manually) but I'm not sure I can find the time to implement that myself.

Thanks for the feedback!
Computer science student and part time game dev! Currently working on Depths of Limbo! :cool:

Check out the game website DepthsOfLimbo.com! :ultrahappy:
And my personal website with all my projects evgiz.net! :megagrin:
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 0 guests