Author Topic: Sprite to voxel(for real)  (Read 7309 times)

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Re: Sprite to voxel(for real)
« Reply #15 on: 2010-May-05 »
It can produce a DDD, in fact my version prior to this did just that.  However that was limited to 16x16x16 at the time, larger models are kind of pushing the limits though.  I'll do a few test and I can reenable to part that exports a DDD file.  I have a way to optimize the model by expanding faces to adjacent like colors, but this ruins normal values.

There's really good example of voxels for the DS on a game called Flipper by Goodbye Galaxy(blog site)
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Sprite>voxel>ddd
« Reply #16 on: 2010-May-05 »
Download s2v_wDDD040510.zip

This version will now create a DDD file after it creates the display model.  You'll be prompted to choose if you wish to reduce the faces, doing this can reduce file size up to half in the best case but will cause issues with normals so be weary if you light the model.

Keep in mind, the larger the dimensions of the image, 128+ may hangup when creating models.  Models are 20times larger than the vox files on average and likewise are just as slow.  Of course there is no current way to display vox files without Ken Silverman's programs: Voxlap, Slab6, Build Engine, and EvalDraw.

I've been emailing someone who had been working on an OpenGL voxel engine, but haven't heard back yet as of my last message.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10760
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Sprite to voxel(for real)
« Reply #17 on: 2010-May-05 »
use AUTONORMALS 0 before X_OBJSTART - makes nice "hard" edges.

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Re: Sprite to voxel(for real)
« Reply #18 on: 2010-May-06 »
I've used it, the normals get weird because it links up a strip of like faces and just makes one long one.  This results in oddities or imperfect normals at intersections of faces, like a T or such shapes.  Since the face is extended beyond the connection point there is no vectors to properly set the normals there.  At least that's my theory.  That and my method is kind of cheap and easy.

Want to see the code?
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10760
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Sprite to voxel(for real)
« Reply #19 on: 2010-May-06 »
No. ;)
Try AUTONORMALS 1 (0 was stupid) and then render the thing with X_CULLMODE 1. If you have holes now, the triangles are in wrong order (outside facing inwards).
Once you have the faces correct with X_CULLMODE 1, the AUTONOMRALS 1 should make really blocky blocks.

Offline Scott_AW

  • Mr. Polyvector
  • ***
  • Posts: 214
    • View Profile
    • SAW Game Design
Re: Sprite to voxel(for real)
« Reply #20 on: 2010-May-06 »
I have both of those set, you'll see what I'm talking about if you load one of the models and apply lighting.  Make two versions of the model, one without the face combination and one with.  Sometimes its not that noticeable if the object shape is simple, but you'll see a difference.  If its not that big a difference, great, because the reduce  mode is much smaller and faster.  Of course if your not using lighting always do the reduce.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/