dragonruby-3d
Installation
SKILL.md
DragonRuby is a 2D engine but supports several pseudo-3D and true 3D techniques.
Sprite-Based 3D (VR / Cube Style)
Build 3D objects from six 2D sprites with x/y/z positioning and angle_x/angle_y rotation:
def cube(x:, y:, z:, size:, sprite:)
half = size / 2
[
{ x: x, y: y, z: z, w: size, h: size, **sprite }, # front
{ x: x, y: y, z: z + size, w: size, h: size, **sprite }, # back
{ x: x, y: y + half, z: z + half, w: size, h: size, angle_x: 90, **sprite }, # top
{ x: x, y: y - half, z: z + half, w: size, h: size, angle_x: 90, **sprite }, # bottom
{ x: x - half, y: y, z: z + half, w: size, h: size, angle_y: 90, **sprite }, # left
{ x: x + half, y: y, z: z + half, w: size, h: size, angle_y: 90, **sprite } # right
]
end