texture-mapping

UV mapping for a dome?

Hi, I am trying to understand how can I change UV mapping of a dome, I need a different texture map projection than this one coded below: protected final void createDome(final float radius) { int lats=16; int longs=16; GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures2x4[0].getText...

Texturing a model

I have coded a 3d-terrain engine with simplistic model engine on top of it. I use a rectangular heightmap for my terrain, so texturing those triangles is pretty straightforward. However, on texturing my model i am a bit stuck. I use a custom model format, so answers like use blender or use 3ds will not be helpful. The reason for this...

rectangular texture in OpenGL with both width and height POT

I'm trying to use rectangular texture with OpenGL. When the height is equal to the width of the texture, everything looks fine, however, when the height is different than the width the texture looks distorted. My display function is (h and w are globals storing the height and the width of the image): Please note that the size of the dr...

Image loading in OpenGL for use in GIS appliation.

I am currently working on an in house GIS app. Background images are loaded in OpenGL by breaking the image down into what I guess are termed texels and mipmapped, after which a display list is built to texture map each texel onto rectangles. This sounds pretty standard, but the issue is that currently for images that do not divide nea...

Strange Problem with Skybox texture size - iPad, OGL Es 2.0

Hi Everyone, I'm new to the iPad dev. platform and currently making a terrain roamer demo with OpenGL Es 2.0. While implementing the skydome, I ran into a really strange problem that I could not solve. Skydome Implementation: * I have a low res sphere that uses a cube map indexed by the sphere vertex normals. * I use 1024x1024 textur...

An UV mapping algorithm to maximize texel density and consistency?

I'm looking for a way to automatically map a 3D mesh's polygons onto UV space such that texel density is maximized and kept as consistent as possible between polygons. Does an algorithm exist that will provide better results in this respect than standard projections such as planar, box, cylindrical, and spherical? ...

Obtaining minimum and maximum rendered UV values (Direct3D)

I need to calculate the minimum and maximum UV values assigned to the pixels produced when a given object is drawn onscreen from a certain perspective. For example, if I have a UV-mapped cube but only the front face is visible, min(UV) and max(UV) should be set to the minimum and maximum UV coordinates assigned to the pixels of the visib...

"sphere in a bag" plane to sphere projection

Hi! I'm looking for the mathematical transformation to transform points on a 2D plane [0,1]x[0,1] onto the unitsphere. The most common projection would latitude-longitude mapping by interpreting u and v as the angles for the spherical coordinates (map u to [0,2PI] and v to [-PI/2, PI/2]) This gives strong distortions on the poles of t...

Trouble sharing textures with OpenGL/Cocoa

I am a bit of an openGL novice and I am trying to get texture sharing to work between two openGL views. I created two NSOpenGL view classes and then in the interface builder I created a window that had one of each openGL view. The first view has code in its prepareOpenGl that sets up the texture and assigns it to a global variable, the...

OpenGL texture blending and translation

I've got two textures mapping to a surface, one is a checkerboard (the pattern on the floor) and one is a lightmap, both of which are blending and presenting just fine. What I'm having trouble with is making the lightmap texture translate prior to blending. I need to do this so I can simulate a flashlight scanning across the floor.... C...

How are UV coordinates measured?

I've got a 3D modeling program exporting a UV mapped 3D model. However the UV coordinates seem to be invalid or using a system I don't understand. I need help in understanding how UV coordinates map to the pixels of the bitmap (X, Y) I've got a couple of textures in the range of 150x100 to 200x600. Here are some extracts: vt 1.040...

Why are these UV mapping coordinates represented in 0-1 and pixels? Shouldn't they use only the 0-1 system?

Well, I've got many UV coordinates of a 3D model clearly in the range 0-1 and many coords in seemingly pixel values in the range 100-300. How do I know which one to interpret the coordinates as? Is there a standard or system for this? I notice that each 3d meshes in the exported file may use either system. Is this normal procedure, and...

Mapping textures to a sphere OpenGL ES

Hi All, Right i am just getting into OpenGL ES, and if i am honest it is very daunting. Just need a little guidance to point me in the right direction for my current challenge. I have some code that produces a 3D sphere, that has a texture mapped on to it (A Globe). I can get the touch co-ordinates on the sphere, and have a handle o...

What am I doing wrong that I can't render an image/texture properly in OpenGL?

I'm trying to render an image to the window. Super simple (or so I thought). No matter what I do, I always get this purple square. Some tidbits of my code: // load image from file, called one time on load: glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel(GL_FLAT); glEnable(GL_DEPTH_TEST); RgbImage theTexMap( filename ); glGenTexture...

How to copy CUDA generated PBO to Texture with Mipmapping

I'm trying to copy a PBO into a Texture with automipmapping enabled, but it seems only the top level texture is generated (in other words, no mipmapping is occuring). I'm building a PBO using //Generate a buffer ID called a PBO (Pixel Buffer Object) glGenBuffers(1, pbo); //Make this the current UNPACK buffer glBindBuffer(GL_PIXEL_UNPA...

OpenGL texutre mapped font rendering

I'm implementing a simple font renderer in OpenGL and have a few questions regarding that It basically loads an image with characters on them into an OpenGL texture Is it better to have one big texture with all characters on it, or can I have one texture per character as well? Using the big texture, I can't seem to figure out how to c...

OpenGL ES for iPhone blending not working

Hello, I'm a beginner to 3D graphics in general and I'm trying to make a 3D game for the iPhone, and more specifically, to use textures that contain transparency. I am able to load a texture (an 8 bit .png file) into OpenGL and map it to a square (made from a triangle strip) but the transparent parts of the image are not transparent when...

How does the R coordinate(float) choose which part of a 3D texture to use? (OpenGL)

I am attempting to use 3D textures to texture my randomly generated terrain. I want to be able to have many different terrain textures that blend between different areas. I can't seem to figure out what part of the texture the R coordinate will pick up. If I set it to 0.0 then it gives a blend of the texture from before 1.0 and after 0.0...

BitmapFileMaterial not loading on embed

Hi Guys, I've built a carousel in Papervision3D using Flash CS5, everything works fine but when it's embedded in a web-page (local or online) the BitmapFileMaterial assets don't seem to load. I've tried everything and like I said, it works locally, just not when it's embedded. Is there something I'm missing? It's a carousel made up of...