How to apply texture to mesh without specifying UV's in geometry using three.js?

試著忘記壹切 提交于 2019-12-12 01:26:00

问题


Is it possible to apply texture to mesh without specifying UV's in geometry in three.js ?


回答1:


There are classes such as THREE.CubeGeometry, THREE.SphereGeometry, etc. that automatically generate the UV coordinates for you. However, if you are creating your own geometry from scratch (i.e., specifying vertex locations, creating faces, etc.) then the answer is no. Either you need to set the UV coordinates manually when creating the geometry, or you need to write a custom shader which determines the UV coordinates for any given point. Think about it this way: if you don't specify UV coordinates, the points on your geometry have no idea which point on your texture they should display.



来源:https://stackoverflow.com/questions/18972672/how-to-apply-texture-to-mesh-without-specifying-uvs-in-geometry-using-three-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!