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

Generate axis grid #8

Closed
Daubsy opened this issue Dec 18, 2014 · 2 comments
Closed

Generate axis grid #8

Daubsy opened this issue Dec 18, 2014 · 2 comments

Comments

@Daubsy
Copy link

Daubsy commented Dec 18, 2014

Im trying to generate grid lines for the x, y, and z axis. I have not found an easy way to accomplish this for a three.js viewer. Any suggestions? Thanks!

@kovacsv
Copy link
Owner

kovacsv commented Dec 18, 2014

Viewer does not support currently to add lines, but you can add them directly to three.js scene like this:

var geometry = new THREE.Geometry ();
geometry.vertices.push (new THREE.Vector3 (0.0, 0.0, 0.0));
geometry.vertices.push (new THREE.Vector3 (-2.0, 0.0, 0.0));
var material = new THREE.LineBasicMaterial ({color: 0xff0000});
var line = new THREE.Line (geometry, material);
viewer.scene.add (line);

See this fiddle for example:
http://jsfiddle.net/0axfbvL9/2/

@Daubsy
Copy link
Author

Daubsy commented Dec 18, 2014

I see. Thanks for the help!

@Daubsy Daubsy closed this as completed Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants