Is it common to use 3D Primitives?

Because all I really see are demos and toy apps I’m curious whether its common in more “pro” apps to use primitives such as BoxGeometry, PlaneGeometry, etc?

In other words, is it common to ponder over the primitive composition of an object I wish to create, or just skip it, and unless its very obvious, like a planet or a donut, start from scratch with BufferGeometry?

I don’t think most developers are spending much time composing the primitive shapes in their three.js code, although the occasional plane or box can certainly come in handy. What to do instead would depend on the style you are trying to achieve:

  • 3D Modeling: For realistic scenes, or stylized or game-like looks, it’s most common to create assets in tools like Blender, Maya, or 3DS Max and load them in three.js.
  • Procedural: Certain styles make more sense to code than to create in modeling software; generative art by people like Jaume Sanchez Elias would be a good example of this. Often this means programmatically generating a BufferGeometry with some known structure and then using GLSL shaders to deform it further.
  • Other: If you’re making something with a deliberately low-poly style, ala Minecraft, the primitive shapes are not a bad choice.

Personally I would start with Blender (https://www.blender.org/); it’s free and has a good glTF exporter, which makes life much easier when you want to bring your work into three.js. This is what you’ll find recommended in courses like https://threejs-journey.xyz/, as well.

3 Likes

Would it be a good strategy to modify the BufferGeometry data itself, ignoring shaders, for something like modeling software like SketchUp? (I’m assuming threes baked in shaders are still used for things like panning, zooming and rotating, so you’ll still get some GPU goodness from those operations.)

To build something like Sketchup? That seems reasonable, yes, and no particular need for custom shaders in this case.

1 Like

Depending on the application, you can mix the methods. There is no reason to strictly separate them.

I myself am interested in procedural creation of shapes. Therefore, I focus on more complicated shapes based on self-created BufferGeometry.

But many things are also better done with a tool like Blender.

Just compare.


Showrooms easy to generate from data of a construction drawing or dimensional sketch.

Construction of frames with contour/profile

Curved2Geometry - a twofold curved geometry

Inner Geometry (Triangulation)

ProfiledContourGeometry MultiMaterial

Modify indexed BufferGeometry (mouse or input)

and others.


See the Resources category here, also many examples from other authors.

1 Like