We're going to be adding support for 3D models into SALD next week. While the exact syntax is up to you to propose, the general idea is that game developers will be able to write code like:
var crate = require("props.blend/CrateV1");
crate.bindTexture(); //set crate's texture as active
crate.draw(); //send vertices, colors, normals/tangents, and texcoords to opengl
This weekend, I'd like you to become familiar with Blender and its scripting system.
crate.blend: A 3D model of a wooden crate, lovingly crafted by you using blender. The model does not need textures or vertex colors, but it should contain more sophisticated geometry than a simple cube; e.g. add some slats or corner braces or something. The crate should have its origin at \( (0,0,0) \) at occupy approximately the \( [-1,1] \times [-1,1] \times [0,2] \) cube. The crate should be a single mesh object in the blender scene, and should be named "Crate".
crate.png: A rendered image of your crate.
export-model.py: a blender python script that prints to the console a list of vertices and triangles in the mesh, when run as follows:
blender --background crate.blend --python export-model.py -- Crate
(NOTE: this informs blender that it should run without UI, load crate.blend, and run export-model.py. Arguments after '--' are ignored by blender, but the script picks them up.)