纹理包装没有重复,因为它应该是 [英] texture wrapping is not repeating as it should be

查看:25
本文介绍了纹理包装没有重复,因为它应该是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为地板包裹纹理,但它不起作用 - 纹理没有按应有的方式重复 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.com/Tesi9.2/ - 选择用户组,然后选择路径,起点终点终点来访问模型

You can see the project here : http://provasitimek.herobo.com/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆