What (exactly) is three.js for?

Wow. So many long comments. I didn’t know that was a deep question :upside_down_face:

Honestly I’m not going to read all the previous comments. I’m just going to answer the title question; I´m not an expert on the subject.

For me threejs is a library that facilitates the use of WebGL. That’s all :3

bye. My mission is now complete :smirk_cat:

1 Like

This is a question that gets asked quite a bit. I wonder if it would be a good idea to add a What is three.js? page to the docs?

The Getting Started page is great but it kind of jumps straight in and assumes you already know what you want to use three.js for.

We could add a simple intro page called What is three.js? before Getting Started that described some things like:

What three.js is (a rendering framework for the web, mostly focused on WebGL but can be used with other graphics APIs too)
What can you use three.js for? (some nice examples of things that have been built with three.js, or even just a link to the main threejs.org page)
What three.js is not (explain that three.js is not a full fledged game engine, has never tried to be, and if you jump in expecting one you’re gonna have a bad time. Then maybe link to some game engines built on top of threejs)
Using three.js with React/Vue/Angular/Svelte (point people in the direction of R3F and similar tools for other frameworks)
Where can I learn more? Link to various places to learn about three.js, as well as the forum, discord, reddit etc.

@mrdoob is that something you would be interested in adding?

There is already the fundamentals page in the manual but I was thinking of something much simpler that avoids any technical details.

11 Likes

I like your suggestion, it would address a lot of my concerns.

From what I understand, this is not correct - you can use three.js for things other than WebGL.

In fact, now that I think about it, I have even written code that uses the three.js library that does no rendering at all - for example, my build pipeline includes a navigation mesh generator that uses Vector3, Plane3, Matrix4 and other geometry classes to do the calculations, but it outputs JSON / Msgpack assets, not pixels.

By the same token, saying that it’s a framework for doing 3D is too broad - there are other kinds of 3D such as 3D printing, or cinematic quality rendering (think Pixar), that fall outside of the expected use cases.

1 Like

I stand by what I said. And the reason for this is that so far 99.9% of the stuff I’ve seen has to do with rendering, canvas etc… So, if this is the case then I can assume that this is the main purpose of Threejs.

For me threejs is a library that facilitates the use of WebGL. That’s all :3

Both of these are valid uses of three.js I think. Here’s a GPU path tracer being written using three.js and there are other around if you search.

For 3D printing you can view and export STL files with three.js.

2 Likes

I have used a scissors to make holes in plastic, a screwdriver to hit some nails (with its back side), a cup to catch mosquitos, you name it - whereas the stated purpose of these tools is different.

4 Likes

This article seems to mention most stuff from this thread:

I also believe that threejs is mostly used for webgl.

After reading the thread it seems that generic nature of Three.js is here ‘an issue’ - in a way that it is a multipurpose ‘tool’ or ‘a layer’ above the WebGL (not only WebGL though). Not targeted to any particular use (like 2d game or web demo etc).

For me three.js works simply to limit the amount of code needed to do something in the browser using WebGL and direct a developer in a certain way of thinking about building up the project.
The codebase though is full of other (useful and clever) stuff that is away from its core purpose.

So perhaps it would be beneficiary for the project, and healthy for the codebase, to split it into some ‘core’ package (the Renderer its core dependencies) - that is sturdy and stable. And the ‘extras’ packages (most of which is currently in examples), like ‘lights’, ‘materials’ or ‘shaders’ other stuff that can be extracted as standalone packages and will be easier extendable and open for growth.

@three/core
@three/materials
@three/objects
@three/shaders 
@three/controls
@three/cameras
...

just some ideas.

4 Likes

It’s primarily a scene graph abstraction, with utilities for rendering the scene graph using browser graphics APIs, as well as math, and file format utilities. Branching out a bit further, it’s an ecosystem of developers and artists utilizing, improving and assisting others with three. That’s how I see three :slight_smile:

2 Likes

That sounds good to me yeah :+1:

1 Like

This whole thread is basically caused by “examples” folder that should be called/split as “plugins” and that’s all :rofl:

1 Like

threejs gives new meaning to programming, the bridge between text and image to the world of unlimitted possibilities.

2 Likes

We are still talking about this😂. It’s just a 3D Renderer my “coder Bros”!!

1 Like

@makc3d @Umbawa_Sarosong @rockclimber Could you guys start a new thread for the off-topic helicopter physics conversation? Each new post sends notifications to dozens of people who have engaged with the original discussion.

3 Likes

As someone who has been building a game with three.js for a long long time, I 100% empathize with your thinking. It was actually kind of cathartic to read.

I’m always worried if some critical feature I use to make my game engine is going to be ignored, regressed in some way or cut in favor of a design choice that prioritizes true-to-life staircase rendering for example. That or some code import method is going to be introduced that completely upends my pipeline.

Regardless of those concerns, I am still here since r49 and with the latest version. Performance and quality are good and I have learned a lot over the years due to three.js’s lack of… specificity and having to take matters into my own hands. No major regrets so far other than a few breaking changes that made me want to cry, but I got through it.

2 Likes

R125 buffer geometry by chance?

Idk, man, I did “engage” with the thread just like any of the rest of you, and all I get is the blue circle when ever I visit the site. If you enabled website push notifications, it is kind of like your problem

1 Like

Three.js just tries to make hardware accelerated graphics programing more attractive.

We may remove niche features from time to time but the reasoning is always to reduce file size or improve maintenance.

The goal is to improve the quality of 3d graphics on the web.

6 Likes

42 == * == whatever you want it to be.

Obviously not suitable for massive games simply because the web browser isn’t suitable for massive games.

Coming from Unity, (and before that Flash) I was glad the authors hadn’t pre-guessed what we’d use it for.

Whenever things have “broken” (changed) between versions, I’ve always found the warning messages very helpful and we’ll thought out and invariably been able to migrate easily, and usually to make use of some awesome new features.

So props to Mr. Doob and team. Whatever the intention, the result has been a platform where I feel I can build anything, within the bounds of what’s sensible in a browser. And I know it will run on mobile.

1 Like