PointsMaterial throws an error

Hi I am a noob with three.js and I want to create a Sphere geometry with a points material, but my code throws a TypeError: Cannot convert undefined or null to object.
this is my code:

var material = new THREE.PointsMaterial();
var geometry = new THREE.SphereGeometry(5, 32, 32);
var sphere = new THREE.Points(geometry, material);
scene.add(sphere);

And I also tried the code given in the documentation of the PointsMaterial, it threw the same error…

Hi!
Why do you think it’s because of the code with points and its material? Maybe it’s from the code that executes before? Any chance to provide an editable live code example, that shows the problem?

Duplicate:

Use SphereBufferGeometry in your case to solve the issue.

1 Like

Thank you so much for responding, I used the v107 and it works fine

1 Like