seeking a bit of advice for something that has kinda get me scratching my head for a day or two.
We all know that any graphics we create within Codea are 2d, no denying it, they are. We can add depth, shading, whatever to simulate a 3rd dimension, but ultimately, bottom line, they’re 2d.
Now, if I was to draw a circle in Codea, it would appear as a circle, again, simple to visualise.
I could then add some shading to that circle to give the simulated appearance of depth, that sad little circle now turns into what our mind thinks is more than likely a sphere.
So far so good, but here’s the problem.
WITHOUT using spherical texture mapping, is there any possible way to give that ‘circle’ / ‘sphere’ the appearance of it moving so the mind thinks it’s a ball in motion?
The only thing I’ve managed to achieve which looks ‘ok’ but far from ‘good’ is a slight wobble (by no more than 3 pixels) in the opposite axis of motion. ie. if the ball is moving up the screen, there’s a slight wobble between left and right - it gives the appearance of a ‘ball’ but certainly not a perfectly rounded sphere.
Can anyone think of any graphic ‘tricks’ that could emulate movement a bit more realistically?
There is a simple technique of colour cycling. I have generated a bouncing ball in a box, when I first started with Codea. To simulate a ‘3D’ sphere I textured it with sequential ellipses of different widths (I’ll try to dig out the link). I was trying to use rotate on it, but sadly at the time didn’t know what I was doing. You could simply use that, but you could enhance it by using a colour rotation cycle for the ellipses to give the impression of curvature and movement.
Then, just using the points, triangulate() the vertices matrix and make each triangle a shaded mesh. You could shade from bottom up and produce quite a nice sphere - I thought about doing it but thought it would take me ages.
The best way to do this would be to cycle through the vertice list applying a programmed color() value so you get a gradual shading change.