uv-mapping

Why does TextureCoordinates work as expected for a Viewport2DVisual3D, but not for a GeometryModel3D?

那年仲夏 提交于 2019-12-07 06:15:46
问题 I have a model that I created in 3ds Max. The model is a simple rectangle. Its texture has overlapping texture coordinates--the model should display the right half of the image file twice, side-by-side. I exported this model as an .obj , and converted it to XAML using Microsoft Expression Blend. I took the MeshGeometry3D from blend, and added it to a Viewport3D using two methods: Use a Viewport2DVisual3D with a Label as its Visual . Set the Label 's background to the texture image. Using this

Is animating a tile in a tilemap (quad per tile) mesh by changing quads uv position logical and efficient?

落爺英雄遲暮 提交于 2019-12-06 16:40:12
I am new to procedural mesh generation and uv mapping from sprite atlas. So I don't know whether a solution that come to my mind is efficient, logical and "best way", or neither of these. I am currently making a procedural tile map "engine-y" in Unity. I had a question about it here few days ago, (i asked whether to use a mesh or multiple sprite objects) and by the given answers i am now proceeding with the mesh generation way. I've created the base structure-framework in my mind. I even made some prototypes. I will map each quad's UV, by the corresponding tile in the sprite atlas. (If there

uv mapping works bad on low resolution (warning: lot of images)

爱⌒轻易说出口 提交于 2019-12-06 09:44:27
TL;DR: is there a way to scale down both UV map and texture without losing the quality of the produced result? Full story: I'm trying to develop a simple rendering engine which would take UV map from .EXR file, put a texture on it and serve to the client. Whole process looks like this: from PIL import Image import numpy as np texture = Image.open("texture.png") texture_array = np.asarray(txt).transpose(1, 0, 2) # assume reading EXR file and grabbing only R and G channels from it uv = read_exr() # scale indexes to texture size uv[..., 0] *= texture.size[0] uv[..., 1] *= texture.size[1] map = uv

Texture shape extrude in three.js

那年仲夏 提交于 2019-12-06 08:46:21
问题 I'm trying to texture an extruded shape in Three.js. In the following code I create a curved shape, extrude the shape, then create a mesh with the geometry and a material I've loaded from a Jpg file. The wireframe displays but the texture does not. The texture is 512*512px in size. Am I using the correct approach? Do I need to manually UV map the texture? I'd like the texture to wrap to the entire extruded face instead of each individual quad. var x = -50, y = 20, z = 150; var rx = 0, ry =

Texture shape extrude in three.js

被刻印的时光 ゝ 提交于 2019-12-04 14:10:34
I'm trying to texture an extruded shape in Three.js. In the following code I create a curved shape, extrude the shape, then create a mesh with the geometry and a material I've loaded from a Jpg file. The wireframe displays but the texture does not. The texture is 512*512px in size. Am I using the correct approach? Do I need to manually UV map the texture? I'd like the texture to wrap to the entire extruded face instead of each individual quad. var x = -50, y = 20, z = 150; var rx = 0, ry = Math.PI/4, rz = 0; var scale = 1; var color = 0x00ff00; var shape = new THREE.Shape(); shape.moveTo( x, y

Put a Cinema 4D model and Texture into an iPhone App

谁说胖子不能爱 提交于 2019-12-04 10:51:40
问题 Im an iPhone developer and i'm trying to get a 3D model that I create in Cinema 4D into an app im making. I have actually found a way to get the model in (by exporting it as a .dae or obj and using a python script) which works really well however I can't get the textures to come with it. My script actually can only handle 1 texture as well. Basically I need to ether create and export a UV map in c4d (but I have no idea how to do this) or I figure out a way to read multiple textures into my

Calculating planar UV coordinates for arbitrary meshes

眉间皱痕 提交于 2019-12-03 15:13:28
I have code that generates triangle mesh from 2d shapes. Because those shapes in most cases have uneven vertex distribution on the surface I have an issue with generation of UVs so that it wouldn't cause texture distortion. Anybody can suggest some articles, books, code samples that talk about techniques of UV calculation on planar meshes? Thanks ok lets see if I understood your question. You have a planar mesh with vertices (x_i,y_i,z_i), since the mesh is planar you can find a rotation which leads to coordinates with z_i = 0 So I'll assume that your mesh is also 2D with vertices (x_i,y_i)

Automatically generating UV coordinates algorithms

喜夏-厌秋 提交于 2019-12-03 03:54:42
问题 I'm writing my own uv editor for a tool of mine, and I'm trying to incorporate as many algorithms as I can for projections. I need to take an arbitrary mesh, and make uv coordinates for each vertex. So far, I have planar, and Least Squares Conformal Map. I'd like to incorporate more, such as tri-planar, cylinder, spherical, but I'm having a very difficult time locating the information to perform the algorithms. The tri-planar appear to generate a color, but I need to get everything in UV

Three.js Efficiently Mapping Uvs to Plane

六眼飞鱼酱① 提交于 2019-12-02 12:22:39
问题 I'm working on a game where there are many walls of the same texture but at different lengths/heights. Currently I am cloning a base texture and setting the repeat values for each wall. This creates to many textures in memory. What I want to do is to alter the planes uvs to fit the textures properly. I took a stab at this a came up with some meh results. var X = 2000; var Y = 1000; var seg = Math.ceil(X/Y); var wallgeo = new THREE.PlaneGeometry(X,Y,seg,1); var uvs = []; for(var i=0,len

Seams on cube edges when using texture atlas with three.js

喜你入骨 提交于 2019-11-29 18:11:11
I have seams between horizontal faces of the cube when use texture atlas in three.js. This is demo: http://jsfiddle.net/rnix/gtxcj3qh/7/ or http://jsfiddle.net/gtxcj3qh/8/ (from comments) Screenshot of the problem: Here I use repeat and offset: var materials = []; var t = []; var imgData = document.getElementById("texture_atlas").src; for ( var i = 0; i < 6; i ++ ) { t[i] = THREE.ImageUtils.loadTexture( imgData ); //2048x256 t[i].repeat.x = 1 / 8; t[i].offset.x = i / 8; //t[i].magFilter = THREE.NearestFilter; t[i].minFilter = THREE.NearestFilter; t[i].generateMipmaps = false; materials.push(