Reputation: 11
Can we use PhongMaterial with texture in three.js
If we can give me some example links.
Please do send me your feedback on the issue. You help is highly appreciated.
Thanks for reading.
Regards, Vijay
Upvotes: 0
Views: 2171
Reputation: 5219
The answer is yes. You can start with this tutorial:
http://www.html5canvastutorials.com/three/html5-canvas-three-js-phong-material/
and then add the following line of code right below the shininess property in the MeshPhongMaterial config object:
map: THREE.ImageUtils.loadTexture('http://www.html5canvastutorials.com/demos/assets/crate.jpg')
This will create a wooden textured cylinder with a Phong material (shiny material).
Upvotes: 0
Reputation: 12632
If you look at the examples directory of three.js you will find plenty of examples that assign textures to PhongMaterial. To name a few webgl_materials_cars.html, webgl_materials2.html and webgl_lights_pointlights2.html. I hope these help.
Upvotes: 1