Skip to content

Not ES6 compatible #4

@sasha42

Description

@sasha42

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions