Sneaky
Sneaky

Reputation: 23

CSS2DRenderer not in Three.js

Some context first :

I installed three.js in a default react project with npm, and I would like to implement this example that uses CSS2D.

However I get this error when creating a new instance of the renderer:

"export 'CSS2DRenderer' (imported as 'THREE') was not found in 'three'.

After looking into the node module, I concluded the issue was that three.js doesn't include CSS2DRenderer in its build, but I may be wrong.

I'm quite new at this and would like to know if it's possible to add that renderer when installing three.js.

I'm open to suggestions or workarounds, all I want is to keep 'fixed' labels in a 3d scene.

Also this is my first post ever, if I can improve my posts in any way please advise me :)

Upvotes: 2

Views: 3081

Answers (1)

Mugen87
Mugen87

Reputation: 31026

You're right, CSS2DRenderer is no part of the library core. If you want to use the renderer, you have to transfer CSS2DRenderer into a separate module. You might want to have a look at the following issue at github in order to check out different approaches for this.

https://github.com/mrdoob/three.js/issues/9562

Upvotes: 1

Related Questions