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

How to detect the clicked face of a cube and change its texture? #1049

Closed
danieljack opened this issue Jan 8, 2012 · 3 comments
Closed

How to detect the clicked face of a cube and change its texture? #1049

danieljack opened this issue Jan 8, 2012 · 3 comments
Labels

Comments

@danieljack
Copy link

How to detect which of the faces has been clicked

http://jsfiddle.net/yfDnJ/6/

@mrdoob
Copy link
Owner

mrdoob commented Jan 10, 2012

I think you should be able to figure out the face bu retrieving the normal vector of the face that you intersected. You should have only 6 different normals ;)

@danieljack
Copy link
Author

I got it in the end just using intersects[0].face.materialIndex for the material index

@mrdoob
Copy link
Owner

mrdoob commented Jan 13, 2012

That's smarter :)

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

No branches or pull requests

2 participants