Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not ES6 compatible #4

Open
sasha42 opened this issue Dec 6, 2022 · 0 comments
Open

Not ES6 compatible #4

sasha42 opened this issue Dec 6, 2022 · 0 comments

Comments

@sasha42
Copy link

sasha42 commented Dec 6, 2022

Hey folks, just spent a few hours scratching my head trying to figure out how to get this to work. Here's some code that works in ES6 with the latest three.js build ("three": "^0.147.0").

First of all, you have to include the following dependency at the top of your file:

import { RoundedBoxGeometry } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";

Then, to create a RoundedBoxGeometry, you have to write the following code:

let geometry_1 = new RoundedBoxGeometry(50, 50, 50, 10, 10);
let material_1 = new THREE.MeshPhongMaterial({ color: 0x00ff00 });
let cube_1 = new THREE.Mesh(geometry_1, material_1);
scene.add(cube_1)

Here's what you'll get:
Capture d’écran 2022-12-06 à 07 31 07

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant