0 Favourites

re skin and bones

This forum is currently in read-only mode.
  • I was playing with the distort map trying to figure that out, when I got the idea to apply a depth map, or bumpmap to set the displacement of a sprite on bones like in davids example:

    http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=2741&st=0&sk=t&sd=a&hilit=bones&start=10

    If you could read the pixel color values of a depth map you could use that info to set the displacement of the skin. It might be much easier to set how much, and where to set the skins displacement this way.

    <img src="http://i43.tinypic.com/1zlulco.jpg">

    You would have to read all the values for every pixel, set up an array to save what the value was for each individual pixel, then read the array and compare each.

    Like wise you would have to set the displace map(in Construct) to sprite.height = rows, and sprite.width= columns, then have an event to convert the array x,y values to column, row, x, and y of the displacement map in Construct.

    So if x,y pixel of the depth map is white, set the x,y displacement of the skin to its highest predefined displacement, then the lowest for black, and gray somewhere in the middle.

    Of course you couldn't do this all the time, but you could read and save the info at the start.

    And it would not have to be black, white, and gray, but grayscale.

    <img src="http://i44.tinypic.com/2z7n5so.png">

    This image shows how it could create constrains, but showing how it would set gray values is a bit harder.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)