|
Author |
Topic: texture() documentation needed (Read 2099 times) |
|
mm Guest
|
texture() documentation needed
« on: Mar 13th, 2004, 4:50pm » |
|
texture() needs documented. also the u/v stuff for vertex needs documented also, i was wondering if it would be possible to do these two things: 1) vertex(x,y,z,alpha,u,v) or vertex(x,y,z,u,v,alpha) 2) alpha() sets global alpha this way you could have alpha-blended texture-mapped polygons, models, etc. t'would be nice!
|
|
|
|
arielm
|
Re: texture() documentation needed
« Reply #1 on: Mar 13th, 2004, 8:24pm » |
|
actually, alpha-blended texture mapping has been here for a while (at least with grayscale images, those whose "format" field is equal to ALPHA): http://www.chronotext.org/processing/babel_1_rv_1/ (note: the code in this example is using the "old" syntax...) nowadays, it's a matter of: Code:fill(r, g, b, a); vertex(x, y, z, u, v); |
| for each vertex inside your "beginShape() / endShape()" block... finally, "textureImage()" is now simply "texture()"...
|
Ariel Malka | www.chronotext.org
|
|
|
fry
|
Re: texture() documentation needed
« Reply #2 on: Mar 13th, 2004, 8:29pm » |
|
vertex(x, y, z, u, v) is a function to spare you from having to put vertex() and texture() commands next to one another, since they're almost always together. texture(u, v) sets the texture coordinate for a vertex. the u and v values go from 0 to 1, and are related to the percentage of the width and height are to be applied at that vertex. for instance, if you only wanted to draw the left half an image, you'd set the u at the left edge's vertices to 0, and the u at the right edge's vertices to 0.5. we probably won't add a global alpha or add alpha to vertex(), since it would break the consistency of the coloring model with the other functions.
|
|
|
|
mm/locke/heg Guest
|
Re: texture() documentation needed
« Reply #3 on: Mar 17th, 2004, 11:36pm » |
|
re: non-global alpha() I would think having the option of a global alpha might be useful, certainly having both wouldn't break consistency that much. re: vertex(x,y,z,u,v) -- would a texture(u,v,a) or a vertex(x,y,z,u,v,a) be hard to implement? also I've noticed a problem with texture() which you have have already addressed, in another post, where some function or feature of processing is conflicting and making "nothing" appear http://www.mugs.net/~locke/processing/planetarium.zip in this applet, if you click out of it into the other mode, there IS a bug where it "switches back" incorrectly -- however, when it "switches back" into mesh mode, we lose the model. if you turn stroke on, it does show the model, but lacks the texture. wierd -h
|
|
|
|
mm/locke/heg Guest
|
Re: texture() documentation needed
« Reply #4 on: Mar 17th, 2004, 11:38pm » |
|
wait is blend() = alpha()? does blend() effect the 3d routines?
|
|
|
|
mm Guest
|
Re: texture() documentation needed
« Reply #5 on: Mar 20th, 2004, 9:37pm » |
|
arielm: vertexTexture(), beginCamera(), endCamera() is not present in p68 thanks anyway
|
|
|
|
mm Guest
|
Re: texture() documentation needed
« Reply #7 on: Mar 21st, 2004, 10:38pm » |
|
nice fish!
|
|
|
|
mm Guest
|
Re: texture() documentation needed
« Reply #8 on: Mar 21st, 2004, 10:40pm » |
|
So basically using fill(255,255,255,alpha) to act as a global alpha (such as the feature I requested).. interesting..will try this out -mm
|
|
|
|
|