I can’t figure out why the three cubes won’t render

Can anyone find out why the code won’t work?

It doesn’t load anything. Just a blank screen.

I am trying to get it to render three spinning cubes.

The link is: https://replit.com/@GenericEngineer/3D-Test

code snippet

There’s two typos in your js.

In the cubeThree object, you’re missing a colon : after color .

const cubeThree = {
  geometry: new THREE.BoxGeometry(1, 1, 1),
  material: new THREE.MeshBasicMaterial({ color: 0x00dd55 }) // added colon here
};

And another typo in the render function where cubeThree.mesh.rotaion.x += 0.2; should be cubeThree.mesh.rotation.x += 0.2; :

2 Likes

I love the Idea that you can have a massive project with thousands of lines of code and you miss one : and it doesnt work anymore

1 Like

Thank you SO much! I didn’t notice those errors before.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.