我搜索在模型上重复纹理.在所有的例子或问题上,我发现只有这样:
var lavaTexture = THREE.ImageUtils.loadTexture( 'images/lava.jpg' );
lavaTexture.wrapS = lavaTexture.wrapT = THREE.RepeatWrapping;
lavaTexture.repeat.set( 3, 3 );
var lavaMaterial = new THREE.MeshBasicMaterial( { map: lavaTexture } );
Run Code Online (Sandbox Code Playgroud)
我理解这一点,但是当材料写成这样:
Wood: new THREE.MeshPhongMaterial( {
color: 0xffffff,
specular:0xffffff,
shininess: 10,
map: new THREE.ImageUtils.loadTexture ( "models/macabann/chataigner.jpg"),
// not sure as right
WrapS : THREE.RepeatWrapping,
WrapT : THREE.RepeatWrapping,
maprepeat : [2,2],
envMap: textureCube,
combine: THREE.MixOperation,
reflectivity: 0.05
} )
Run Code Online (Sandbox Code Playgroud)
如果可能的话,我会搜索如何以这种格式写出这个.谢谢你的回答.
我没有在openCV中找到任何在java中将平面图像转换为圆柱形的示例,我希望它在2d而不是3d中渲染图像,也没有找到任何示例代码或书籍.下面是我想在杯子周围扭曲的图片的图像.
一本好书和示例代码将非常感激.
到目前为止我已经这样做了.建议我的@Amitay使图像凹陷,使用此示例将图像包裹在圆柱体周围但卡在转换上.
import java.io.File;
import org.bytedeco.javacpp.indexer.UByteBufferIndexer;
import org.bytedeco.javacpp.opencv_core.Mat;
import org.bytedeco.javacpp.opencv_core.*;
import static org.bytedeco.javacpp.opencv_highgui.imshow;
import static org.bytedeco.javacpp.opencv_highgui.waitKey;
import static org.bytedeco.javacpp.opencv_imgcodecs.CV_LOAD_IMAGE_COLOR;
import static org.bytedeco.javacpp.opencv_imgcodecs.imread;
/**
*
* @author BTACTC
*/
public class CupWrapping {
Mat image;
Mat dstImage;
int width;
int height;
public CupWrapping(File imageFile) {
image = imread(imageFile.getAbsolutePath(), CV_LOAD_IMAGE_COLOR);
width = image.size().width();
height = image.size().height();
dstImage = new Mat(width, height, image.type());
UByteBufferIndexer sI = image.createIndexer();
UByteBufferIndexer sD = dstImage.createIndexer();
for (int y = 0; …
Run Code Online (Sandbox Code Playgroud)