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

Add floor texture to scene #55

Closed
Piyush3dB opened this issue Apr 19, 2018 · 5 comments
Closed

Add floor texture to scene #55

Piyush3dB opened this issue Apr 19, 2018 · 5 comments
Assignees

Comments

@Piyush3dB
Copy link

Hello @vasturiano ,

First of all thanks for the fantastic library!

I have a requirement where I'd like a "floor" to appear beneath my 3D force graph - essentially a plane geometry with image texture. Is there a function I can call on the ForceGraph3D object to achieve this?

Best Regards,
@Piyush3dB

@vasturiano vasturiano self-assigned this Apr 20, 2018
@vasturiano
Copy link
Owner

Hi @Piyush3dB, thanks for reaching out. From the latest version (1.30.0) there is a new method exposed: scene(). You can use that method to access the ThreeJS scene and extend it with other objects like the "floor" that you mentioned.
Something along the lines of:

myGraph.scene().add(<Object3d>)

@artyomtrityak
Copy link
Contributor

@Piyush3dB here is an example #66

@Piyush3dB
Copy link
Author

screen shot 2018-05-02 at 07 07 47

@artyomtrityak, thanks for the example. I ran the example locally and what I see during the rendering is a red plane initially which immediately changes to a red node and stays that way.

Is this what you also got?

@vasturiano
Copy link
Owner

The underlying issue was that three.js was being loaded after 3d-force-graph (it includes its own three if there is none readily available at import time). That will lead into there being two parallel copies of three.js running in the page, which leads to the interference you mentioned above. I've fixed the example to load three.js before 3d-force-graph, and it's fixed:
https://vasturiano.github.io/3d-force-graph/example/scene/

@Piyush3dB
Copy link
Author

Thanks @vasturiano that works great now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants