psxsdk

morph

A textured sheet morphing into a cylinder, a torus and a sphere, vertex by vertex, as it tumbles.

Controls

Start and Select together quit.

A port of Sony's Net Yaroze demo "morph" (S. Ashley, 1997): a textured sheet that turns into a cylinder, a torus, a sphere and back into a sheet, at 640 by 480. The sheet is a TMD built in memory at startup, a grid of textured quads over a 256 by 256 picture with lighting off and both faces drawn, and every frame each of its vertices moves one unit towards the matching vertex of the shape it is becoming, so that the shape changes over a few hundred frames while the whole thing tumbles. The library's font prints the count of horizontal syncs a frame takes.

Differences from the original:

  • The sheet has a coordinate system of its own. The original points it at WORLD, the library's nil coordinate system, and writes its transformation through that pointer, which in C silently overwrites the kernel's memory at address 0.
  • The quads' headers carry the lengths the TMD format gives a textured quad without lighting, seven words in and nine out. The original writes six and seven.
  • The flat sheet's vertices are computed at startup. The other three shapes are the tables the original's mesh generator wrote.

Nothing allocates after startup.

Source on GitHub