Best New
Next update Just shipped

GML implementation: is this visual issue OK, any better ideas?

tree in gml

link if broken: https://imgur.com/nhFROKA

So I took this tree by Mr. Henri and implemented it into Gamemaker.

The code I used is

/// In draw
for (var i = 0; i < image_number; i++) 
{
draw_sprite_ext(sprite_index, i, x, y - i, image_xscale, image_yscale, image_angle, c_white, image_alpha);
//draws the next sprite in the sprite sheet i pixels higher
}

/// In Step
image_angle++

But as seen by the circles, when it rotates like this it causes this weird 2d stacking issue.

Is there a better way to implement this, or should I just use the prerendered rotation angles?

Tue Jun 18 2019 17:51:53 GMT-0400 (EDT) by SurgDev

Discussion (1)

Login to comment

Zedphyr Tue Jun 18 2019 23:00:12 GMT-0400 (EDT)
0

This is a problem related to the planar nature of the slices. Imagine you are drawing a cube. When separated into slices you have the top and the bottom of the cube. when not looking straight down you can see the sides of the cubes, except now that you have slices, they are not there. this leads to the effect you're seeing. As far as solutions you could just stack 4 sprite per slice to get it closer (which doesn't fix it and is bad for performance.) Or you can use the prerender with the cost that you'll have to use pre rendered angles, aka 0, 45, 60 or 90. The Last solution is to render out each slice through the gif maker. This would give you proper cubes and allow you to stack the sprite together. This has the downside of only showing at the 0,45, 60, 90 angle but allow the camera to swivel around that angle.(The previous method might allow that too but I didn’t have time to test.) If it works out good I would like to see that become a feature. Those are the three methods that I can think of to help you with your problem.