We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware,  Documentation,  Website Suggestions › question about the default textureMode()
Page Index Toggle Pages: 1
question about the default textureMode() (Read 1144 times)
question about the default textureMode()
Mar 15th, 2008, 6:18am
 
I was curious about why the default textureMode is set to IMAGE. I understand that this is so you can set the image pixel values of the UV's on a polygon. However I've never encountered a 3D package that uses image pixels as UV values.

Are there any 3D packages that support UV editing in whole number pixel values? If so how do they handle rescale of textures?

I'm used to 3DMax, Maya and XSI where the UV's work in a NORMALIZED space and consequently don't care about the pixel size of the texture on the polygon.

So I guess my question is. Does having the default textureMode set to IMAGE send the wrong information to people just getting started with UV coordinates?

This week one of the users of the OBJ Loader discovered a problem where their IMAGE set UV's were being blown away by the OBJ Model draw (which is set to NORMALIZED). I'd never thought about it before but now I'm curious as to why IMAGE is the default anyway.

If there is no plans to change the default mode to NORMALIZED I guess I should change the OBJ and Collada loader to change back to IMAGE at the end of draw.

mattD
Re: question about the default textureMode()
Reply #1 - Mar 16th, 2008, 5:00pm
 
because people just getting started with 3D graphics tend to be baffled by the idea of mapping image coordinates (based on pixels) to values between 0 and 1. so for them, we default to IMAGE, and for people who care, they have the option of changing it to NORMALIZED.
Re: question about the default textureMode()
Reply #2 - Mar 16th, 2008, 9:23pm
 
It does smell of hiding the truth a little. But I see your point. I'll sort out the collada and obj loaders to swap back to textureMode(IMAGE) at the end of their draw.

MattD
Re: question about the default textureMode()
Reply #3 - Mar 17th, 2008, 8:44pm
 
polymonkey wrote on Mar 16th, 2008, 9:23pm:
It does smell of hiding the truth a little.

right, and so does letting people use functions called "loadImage" and "image" to download and manipulate pixels from an image, rather than making them open an http stream, pull the bits into an array, parse the image as png or whatever, build an array of the pixel data, bind it as an opengl texture, and then render them into an opengl drawing context.

point being, your idea of "truth" is a bit romantic. Wink
Re: question about the default textureMode()
Reply #4 - Mar 17th, 2008, 10:09pm
 
I'm sorry Fry, I think I worded that wrong. And I certainly didn't mean any offense. I'm all for the convenience of functions like loadImage() over the horrors of using an input stream. Smiley

My only thought was that knowing the IMAGE co-ordinate system is a skill that you can't move onto other 3D packages. But I understand how the NORMALIZED system can be confusing to people starting out.

MattD
Page Index Toggle Pages: 1