纹理包装没有重复,因为它应该是

编程入门 行业动态 更新时间:2024-10-27 15:27:17
本文介绍了纹理包装没有重复,因为它应该是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试为地板包裹纹理,但它不起作用 - 纹理没有按应有的方式重复 5 次.这是我使用的代码:

I'm trying to wrap a texture for the floor, but it doesn't work - the texture is not repeated 5 times as it should be. Here s the code I used:

var floorTexture = new THREE.ImageUtils.loadTexture( 'textures/floor.jpg' );
floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping; 
floorTexture.repeat.set( 5, 1 );
var floorMaterial = new THREE.MeshPhongMaterial( { map: floorTexture, side: THREE.DoubleSide } );
var floorGeometry = new THREE.PlaneGeometry( 45, 44.5 );
var floor = new THREE.Mesh( floorGeometry, floorMaterial );

你可以在这里看到这个项目:http://provasitimek.herobo/Tesi9.2/ - 选择用户组,然后选择路径,起点终点终点来访问模型

You can see the project here : http://provasitimek.herobo/Tesi9.2/ - choose the userGroup, then the paths, the startPoint end the endPoint to visit the model

推荐答案

你必须确保你的纹理大小是 2 的幂.

You have to make sure that your texture has sizes which are power of two.

通常 WebGL 不支持 NPOT(非 2 的幂)纹理.尽管在 非二的幂纹理

Generally WebGL does not support NPOT (non-power of two) textures. There are some exceptions though outlined at Non power of two textures

这篇关于纹理包装没有重复,因为它应该是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 14:48:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1395680.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:纹理   因为它   应该是

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!