Skip to main content
gamedev.net
🔒 Locked

automatic texture coordinate generation

Started by jsaade Feb 26, 2007 at 2:05 AM 0 replies 650+ views
Original Post
jsaade
jsaade
I have searched the forum for such topic but wasn't lucky. I would like to discuss this topic in a non-api way. I know Opengl has GlTexGen, but it's effect is not pleasing (at least to me). I am talking about having an object of any shape, and a texture, then the object will be assigned some good texture coordinates that will wrap or let me say make the texture seems covering the whole area of the object without wrapping or repeating. The OGL sphere map does something like that but it is eye linear, I wrote my own similar function, but the problem with such a sphere map is some not-so-correct mapping on faces lying on the upper and lower faces of a cube. Some would tell me use cube map if the object is a cube, but I am looking for something general, I do not know the shape of the object. I also tried cylinder mapping which also gave me the same kind of distortion. If there such an algorithm, I would really appreciate some notes,books or info about it.
relsoft
relsoft
I could only help you with quadrics. Sphere's, toruses, supershapes, etc where the vertices are arranged in rows and columns.

v = (((rowloop) / (rows) ) * repeatfactor)  u = (((columnloop) / (columns) ) * repeatfactor)


Where repeatfactor is how many times your texture would want to tile.

Here's a demo using the superhape:


Super shape Morpher
Hi.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.