%D \module %D [ file=meta-imp-meshes-demo, %D version=2026.06.09, %D title=\METAPOST\ Graphics, %D subtitle=3D Plug-in Demo, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. %D This is a simple demonstration of how to plug code into the 3D generator. You can %D find some examples in the other \typ {meta-imp-meshes-*.mkxl} files. \startluacode metapost.registermesher("demo", function(specification) return { name = "demo", id = specification.id, vertices = { { 1, 1, 1 }, { 3, 1, 2 }, { 3, 3, 3 }, { 1, 3, 3 }, }, meshtype = 7, -- [1 2 3] [ 1 3 4 ] [5 6 7 ] 5 7 8 ] ... } end) \stopluacode \continueifinputfile{meta-imp-meshes-demo.mkxl} \setupbackgrounds [paper] [background=color, backgroundcolor=darkblue] \starttext \startMPpage lmt_scene_start [ bytemap = 34, width = 100, crop = true, supersample = 4, projection = "perspective", eye = (-2,-2,1), target = (0,2,1), ] ; lmt_scene_material [ name = "surface", diffuse = (1,1,0), ] ; lmt_scene_internal [ id = "one", name = "demo", material = "surface", ] ; lmt_scene_render ; drawdot (lmt_scene_point (1, 1, 1)) withpen pencircle scaled 1 withcolor darkred ; drawdot (lmt_scene_point (3, 1, 2)) withpen pencircle scaled 1 withcolor darkred ; drawdot (lmt_scene_point (3, 3, 3)) withpen pencircle scaled 1 withcolor darkred ; drawdot (lmt_scene_point (1, 3, 3)) withpen pencircle scaled 1 withcolor darkred ; lmt_scene_stop ; \stopMPpage \stoptext