new_3dmodel(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’– new_3dmodel β€” the Arcan Lua API glow-up πŸŽ€

okay bestie, so the manpage name is new_3dmodel from section 3, and it lives in the Arcan Lua API family. let's get into it ✨


🌸 NAME 🌸

new_3dmodel β€” literally just allocates you a VID and a 3D Model container in one go. two for one, slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

modelvid
new_3dmodel()

so you call it, and it hands you back a modelvid. iconic. no args, no drama 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the vibe: just like your regular VID s, 3D models start out hidden β€” like, opacity < EPSILON hidden, fully ghost mode πŸ’€ even if you go and set it visible, no draw calls will be issues until the model has actually been populated with meshes. empty model = no art, periodt.

once you do fill it up, the meshes get drawed in insertion order, so the order you add them is the order it draws, no cap.

also heads up: vertices may be rescaled to 0..1 * factor using scale_3dvertices, and lowkey important β€” that call takes the entire chain of meshes into consideration. so it's not just doing one mesh, it's looking at the whole squad 🌈


⭐ NOTES ⭐

  1. if a model isn't at all visible, first try setting a single color shader for troubleshooting, then check video_3dorder to make sure that 2D elements aren't occluding it. also like β€” a camera must have been activated through the camtag_ class of functions. no camera, no view, iykyk 😭
  2. by default, individual meshes doesn't have a full state akin to a complete VID, and the only attribute that can really be assigned (at quite some cost) to individual meshes are the active shader. so yeah, it's giving "limited edition" πŸŽ€
  3. order of traversed 3D objects depend on the active camera and may not necessarily follow the regular order_image class of functions. so don't assume, bestie πŸ™ˆ

πŸ”₯ EXAMPLE πŸ”₯

function new_3dmodel0()
      vid = new_3dmodel();
      show_image(vid);
      add_3dmesh(vid, "testmesh1.ctm");
end

look at that. allocate, show, add a mesh. chef's kiss πŸ“


πŸ’œ SEE ALSO πŸ’œ


that's the whole page bestie, go build something gorgeous πŸ§šπŸ’–

3d β€” October 2026 β€” mwah, that's the version and date sign-off, catch you in the next manpage πŸ’…

πŸ“¦ where this page comes from