1

I'm new to ThreeJS so this is probably something relatively trivial that I'm not understanding. But I'm in the process of adapting a demo I found for drawing cubes to do 3D scatter plots. I've had no issues adding data points, etc. But I now want to add a grid to parts of the cube. I am trying to use GridHelper to do this.

That said, I'm having difficulty getting the grid to align with the floor of the cube. As you can see at the link below, the dimensions of the grid match correctly, but the cube needs to be rotated for the grid and cube to match up.

Below is a link to what I currently have:

http://wxalert.info/private/scrap/3dplot.html

Any help would be greatly appreciated.

1 Answer 1

1

Add the grid as a child of the scatter plot, instead as a child of the scene.

scatterPlot.add( gridXZ );

Also, pointGeo.__dirtyVertices = true; is very old code.

Are you copying outdated code from the net -- or from an outdated book? Learn from the three.js examples that work with the current version of the library.

See the Wiki article How to Update Things with WebGLRenderer.

three.js r.63

Sign up to request clarification or add additional context in comments.

1 Comment

Doh! That makes sense. I figured it was something trivial I was missing. Thank you! Also, thanks for the heads up on the deprecated code...much appreciated!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.