Sprite mesh distortion problem

For questions about using Classic.

Post » Tue Nov 25, 2008 7:38 pm

I've got a problem, and I need a quick answer. Are sprite distortions broken in the latest build, or am I doing something wrong? Here are the events:

[code:2ppcaqoy]System: Start of layout
> Sprite: Set distort map size to 16, 16

System: For "x" from 0 to 16
System: For "y" from 0 to 16
> Sprite: Set displacement at (loopindex("x"), loopindex("y")) to (sin(timer * 0.05 + loopindex("y") * 15) * 0.05, cos(timer* 0.05 + loopindex("x")*1200) * 0.05)[/code:2ppcaqoy]

When I run the .cap, nothing happens. The sprite just sits there perfectly still. I stole the math from David's example:

viewtopic.php?f=16&t=1502

David's example also doesn't seem to work any more, when I run it the sprite disappears so I can't even tell if it's distorting :?

Please help! I'm on a deadline, so I need to know if there's a way to make this work or if I should start animating an effect by hand...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Nov 25, 2008 7:59 pm

I think they changed the way of representing the coordinates from some units to pixels. Try to remove the 0.05 and see if the effect becomes visible, I think it's that the displacements are currently so small that you can't notice the effect.
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Tue Nov 25, 2008 8:16 pm

Hot damn! You just saved my ass :D

Thanks, Drasa!
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Nov 25, 2008 10:31 pm

Yep, it was changed from texture coordinates (ie. ratios) to pixels, because it's much easier to work out.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests