textures

How to manipulate texture content on the fly?

前提是你 提交于 2019-12-17 17:29:20
问题 I have an iPad app I am working on and one possible feature that we are contemplating is to allow the user to touch an image and deform it. Basically the image would be like a painting and when the user drags their fingers across the image, the image will deform and the pixels that are touched will be "dragged" along the image. Sorry if this is hard to understand, but the bottom line is that we want to edit the content of the texture on the fly as the user interacts with it. Is there an

Bump-map a sphere with a texture map

自作多情 提交于 2019-12-17 17:23:51
问题 We would like to bump-map a sphere with a texture map. However, the surface of the sphere has an area that is 10 times the area of the texture map(area for both in pixels). Describe different ways in which the texture map can be used for bump mapping. 回答1: usually rectangle texture is used for spheres texture (u,v) coordinates are used as angles for spherical coordinates. The result is that texels are bigger near equator and smaller near poles. At poles all the texels merge to single pixel.

Android OpenGL2.0 showing black textures

杀马特。学长 韩版系。学妹 提交于 2019-12-17 16:13:37
问题 I am trying to draw textures onto quads in OpenGL2.0. So far I got the quads to show up and everything, but the textures are not there - the quads are all black. My main suspicion is that i'm not mapping the textures correctly - my textures are not powers of 2, nor are they square - their width is in the field mWidth and their height in mRowHeight. The quads are drawn in a vertical list, which is done with a translate matrix. I'll be very grateful if anyone can go over this cause I'm

sf::Texture as class member doesn't work?

北战南征 提交于 2019-12-17 14:52:20
问题 Heyy, I want to draw a sprite in my SFML application but its texture is always white when I use an image and a texture that are class members Class members: sf::Sprite myimg; sf::Image myimg_image; sf::Texture myimg_texture; When I then create the sprite like this in my cpp file // create image myimg_image.create(icon.width, icon.height, icon.pixelData); // create texture from image myimg_texture.create(icon.width, icon.height); myimg_texture.update(myimg_image); // apply texture to sprite

DAE files image texture doesn't show up in Aframe when exported from Maya

≡放荡痞女 提交于 2019-12-17 14:24:21
问题 I've exported an .dae file with an image texture from Maya. But when that .dae file is used with Aframe, the image texture does not appear, and you can only see the base material. What exporter can I use with Maya that will fix this problem? Below is the same .dae file in PSD, and Aframe: UPDATE: Injecting the model as a Threejs.json via a script works, but kinda defeat the purpose of using AFrame. Screenshot 回答1: I presume You added Your collada ( dae ) model like presented on the aframe

Using Two Textures: Output Window Doesn't Retain On Screen

自闭症网瘾萝莉.ら 提交于 2019-12-14 03:58:19
问题 This code initially uses one texture. I duplicated some functions to use two textures. There doesn't seem to be any errors but when I run I only see the black command window for a bit then it closes. Is there any additional line that I should add? #include <GL/glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include "support.h" using namespace std; /* GLUT callback Handlers */ MYPOINT*ptsW,*ptsR; MYFACE *faceW,*faceR; GLuint *images; GLubyte *image; GLuint texture; void

Sobel filter in x direction in CUDA

只愿长相守 提交于 2019-12-14 03:49:19
问题 I am trying to apply a sobel filter on a grayscale image in the x direction on each pixel and displaying the result. X direction sobel filter is:- -1 0 1 -2 0 2 -1 0 1 I am not getting the required results. Can someone point out my mistakes? I am trying to use textures and I am not so sure as to whether I have used it correctly: #include <cuda.h> #include<iostream> using namespace std; #define CudaSafeCall( err ) __cudaSafeCall( err, __FILE__, __LINE__ ) #define CudaCheckError() _

PNG image texture format for color type 3

╄→гoц情女王★ 提交于 2019-12-14 02:39:00
问题 I have a PNG image of 128x128 dimension. When I read its IHDR chunk with libpng it shows that the image has color type 3. The problem is I cant find anywhere what should be the texture format for this color type. I want to draw this image with OpenGL. But without correct texture format the image color is not what it should be. And also If any reference could be provided where I can read detail about this matter will be greatly appreciated. I use this method to set texture format for other

How to use multiple textures on a cube in WebGL?

馋奶兔 提交于 2019-12-13 23:30:39
问题 This is my source code. It still doesnt work. I want to put 6 different pictures on the 6 sides of a cube, which is animated. Please help :) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> <title>WebGL</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="glMatrix-0.9.5.min.js"></script> <script type="text/javascript" src="webgl-utils.js"></script> <script id="shader-fs" type="x-shader/x-fragment">

Terrain Texturing

醉酒当歌 提交于 2019-12-13 20:44:42
问题 Is there a way to blend 2 textures in a gradient manner? ex. first textures starts at top and goes to the bottom, and second one starts bottom and goes top. I want to make them loose opacity like in a gradient to create a smooth connection. Is it possible? Maybe there is some other way to create such textures? The problem is that the difference in heights in my terrain does not look really well - in one square area, one triangle has a different texture than the other. 回答1: For every terrain