Texture mapping is a method for adding detail, surface texture (a bitmap or raster image), or color to a computer-generated graphic or 3D model.
Questions tagged [texture-mapping]
971 questions
3
votes
1 answer
Sampling from a texture in OpenGL is black
I'm trying out my hand at graphics, following a tutorial at http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_06
Problem: When I try to texture my cube, my sample is black.
Screenshot: http://puu.sh/2JP1H.jpg (note: I set blue =…

nate
- 58
- 1
- 1
- 6
3
votes
1 answer
Textured point sprites in OpenGL 4.3
Is there a way to apply a texture to a point sprite in OpenGl 4.3? I've searched around the internet but most tutorials and guides are using older versions that still support:
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
However this…

IntSec
- 41
- 4
3
votes
1 answer
OpenGL binding textures to vertex buffer objects (with CG Shaders)
I'll get straight to the point:
I have created a structure for my vertices:
struct Vertex3D
{
Vector3D position;
Vector2D textureCoordinate;
Vector3D normal;
}
I then import a particular *.dae file and bind it to a OpenGL Vertex Buffer,…

VoltairePunk
- 275
- 4
- 13
3
votes
2 answers
How to catch glTexImage2D error when resolution is incompatible?
I am trying to catch the error that comes from incompatible image texture resolution in
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img->width, img->height, 0, GL_RGB, GL_UNSIGNED_BYTE, imgdata);
1. Compatible resolution, working fine = 1024x1024,…

maxpayne
- 1,111
- 2
- 21
- 41
3
votes
1 answer
How to load a texture onto a circle with OpenGL ES
I am facing problems on loading a texture onto a circle. My circle is made with a triangle fan. It gives a bad output.
Original Image:
The Result :
My code:
public class MyOpenGLCircle {
private int points=360;
private float…

Siddharth-Verma
- 234
- 3
- 13
3
votes
1 answer
Texture mapping on a cylinder
I want to apply an uniform checkerboard texture to a cylinder surface of height h, and semiradii (a,b).
I've implemented this shader:
Vertex shader:
varying vec2 texture_coordinate;
float twopi = 6.283185307;
float pi=3.141592654;
float ra =…

linello
- 8,451
- 18
- 63
- 109
2
votes
0 answers
How to export a reconstructed 3D model with texture using insight3d
I am using the open-source structure-from-motion program: insight3D to reconstruct a 3D model from a set of 2D images. I was able to export the resulting model as an VRML (.wrl) file but the texture and texture coordinates were not included when I…

Ken Toh
- 3,721
- 1
- 24
- 30
2
votes
1 answer
Drawing a polygon with color in OpenGL causes texture colors to change
I'm working on a simulation program that draws points and other primitives on top of a large 2D rectangle with a texture mapped onto it.
The problem is, when I draw a polygon and specify a color for the vertices using glColor3f, that color appears…

Timoteo
- 259
- 3
- 10
2
votes
1 answer
FBO: render to texture, wrong texture mapping when drawing rendered texture
I'm using OpengGL on a Mac OS X application to draw texture on a NSOpenGLView.
The app is a movie player. It decodes movie frames into CVOpenGLTextureRef (which are OpenGL texture) and I draw them directly to the view using GL_QUAD. Everything works…

Andrea3000
- 1,018
- 1
- 11
- 26
2
votes
1 answer
Render face of cube map to a quad
I have a cube map texture in OpenGL, and I'd like to render one face of the cube to a single quad. What texture coordinates should I use? To be concrete, what coordinates should I pick to render the "GL_TEXTURE_CUBE_MAP_POSITIVE_X" face? Or if I…

Carl Veazey
- 18,392
- 8
- 66
- 81
2
votes
3 answers
how to draw image in opengl android
i have to draw bitmap in to the my live wallpaper using this code but image will not loaded its showing null pointer exception.
public class Square {
private FloatBuffer vertexBuffer; // buffer holding the vertices
private float vertices[]…
user1127616
2
votes
1 answer
Imitate Polygon Stipple with OpenGL ES on iOS
I want to fill a concave polygon with a simple repeating pattern. I can already draw the polygon properly, unfortunately I am having problems with filling it. In OpenGL I could do this easily with POLYGON_STIPPLE. However this functionality is not…

gebirgsbärbel
- 2,327
- 1
- 22
- 38
2
votes
1 answer
How to correctly find UV on sphere
I have a sphere and a texture for it.
Texture consist of 16 tiles of zoom = 2 from OSM. Tile size is 256x256.
At top and bottom I added space to cover area in ranges [90, 85.0511] and [-85.0511, -90], proportionally. So texture size was…

Dmitry
- 87
- 1
- 8
2
votes
0 answers
texture mapping using bilinear interpolation
I have been trying to achieve texture mapping using the bilinear interpolation method.I have been trying to rasterize a triangle thus i first find the barycentric weights and then try to interpolate the uv co-ordinates but have got no success. Could…

noddy
- 1,010
- 4
- 14
- 27
2
votes
0 answers
Converting ARAnchors to SCNGeometry with texture image is stretching
I am using WorldTracking in ARKit and converting ARAnchors to SCNNodes to display it later using SceneView. Here is the code for adding new anchor and I am adding new node on each anchor added.
func renderer(_ renderer: SCNSceneRenderer, nodeFor…

Zia ur Rehman
- 331
- 1
- 2
- 20