PDA

View Full Version : Applying the same texture to individual polygons?



Paul_Boland
03-05-2011, 07:37 PM
Hi Folks.

I have a starship model which has a number of windows around it. I have one window texture which I want to apply to every window on the ship, but I'm having problems achieving this.

I selected each window (which is a single polgon) and gave it the texture name, "Window". Then when I applied the window texture, no matter what I did, Lightwave tried to span the window texture across all the polygons. What I want is to have that window texture fitting snug in each window, on each window polygon.

The only way I see to do this is give each individual window a unique texture name (Widnow1, Window2, Window3, ...) and then apply the texture to each window that way, which does work, but with so many windows on the ship, it's a daunting task. Surely there has to be way to tell Lightwave to put that window texture image onto each polygon window?

jeric_synergy
03-05-2011, 07:45 PM
Someone else will correct me on this, and I'm VERY ignorant about UV textures (so take this what it's worth), BUT and it's a big but....:hey::

I think the solution is UV textures. The question is, how to get all these windows to share the same UV space?

I think the way to do it is:

Select ALL your windows.
CREATE a UV map. Use the ATLAS projection.
Your windows should appear as separate rectangles in the UV viewport.
Move the points of your windows to lie (lay?) on top of each other in UV space.
Now, all your polys share the same UV space and should appear identical.

Obviously, your Texture has to be able to use UV mapping to make this work.

jeric_synergy
03-05-2011, 08:16 PM
Yup. see image. Distortions are from the polys being radically differently shaped. It'd be best if your window polys were all the same shape, although of course you can conceal their true shape by their frames.

Making the UV isn't TOO onerous, but make clever use of your selection tools and SET UV VALUE. Only mildly tedious.

(the one black rectangle is one I screwed up when I was moving its points in UV space.)

BTW, "Sel Switch" or "Sel Points" (Select Points) is invaluable when working w/UVs, imo. Allows you to select the points a poly is composed of.

Sensei
03-05-2011, 10:42 PM
The only way I see to do this is give each individual window a unique texture name (Widnow1, Window2, Window3, ...) and then apply the texture to each window that way, which does work, but with so many windows on the ship, it's a daunting task. Surely there has to be way to tell Lightwave to put that window texture image onto each polygon window?

If naming surfaces differently solve your problem immediately, you should make one such, then record size of texture (which is probably set to automatic), then select all polygons, and reenter recorder values.

UV approach - use Maps > Polygon Maps > New Quad Map..

jeric_synergy
03-06-2011, 12:02 PM
After spending ten minutes working out the UV solution to this problem, the next day I remembered something I learned from Jonny Gordon's EXCELLENT "Cartoon Character Creation: Vol 2 (http://www.amazon.com/LightWave-Cartoon-Character-Creation-Animation/dp/1556222548/ref=sr_1_1?ie=UTF8&qid=1299437887&sr=8-1)" surfacing chapter. :thumbsup:

Somewhere (look it up) there's a projection method called "Quads", IIRC. What it does is project the same image/texture onto every polygon in a mesh. (It was demonstrated with an eyeball texture on a cartoon pig head mesh-- very macabre.) It projects on the polys normal, so it the poly's orientation doesn't matter.

This sounds perfect for a number of polys scattered thru a model, and would have saved me ten minutes mucking about with that sphere above.

Paul_Boland
03-06-2011, 08:14 PM
Great stuff, thanks for the replies. Going the UV Map route sounds like just as much work as giving every window a unique name. There are a LOT of windows, imagine having to set up UV's for them all!! Eek!!! The Quads projection method sounds hopeful, and I have that book here, so I'll see if I can locate it and see if it will work. I certainly didn't think putting the same texture on a load of polygons would be so much work!!

Sensei
03-06-2011, 09:12 PM
Imagine you have quad polygons- each polygon vertex in UV will have value 0,0 1,0 1,1 or 0,1.. That's what Poly Maps > New Quad Map is doing..

jeric_synergy
03-07-2011, 01:47 AM
Great stuff, thanks for the replies. Going the UV Map route sounds like just as much work as giving every window a unique name. There are a LOT of windows, imagine having to set up UV's for them all!! Eek!!!
Well, how many are a LOT? I did 72 rectangles in 10 minutes, and I didn't even know what I was doing. I could re-do it in maybe 5. (CANCEL THIS, see below...)

Remember, ALL you are doing is moving the corners to the corners of UV space, and you can do that EN MASSE with the UV equivalent of SET VALUE. They are all the same UV.

Actually, I just came up with a very slick way of selecting one point on each of thousands of quads: (SEE JPEG) Using "Select Nth" I made the illustrated selection with ONE CLICK. It's not perfect in this example, but it would make it easy to select hundreds of points. I think the OFFSET parameter will allow you to step thru the points, making Selection Sets as you go.

Then using Set UV Value, you can easily move points en masse to the corners of the UV space. Since they are windows, even this example would work, and give some variety by flipping them left to right.

Paul_Boland
03-10-2011, 09:32 PM
Wow, that's cool!! I'll have to do some testing and see if I can recreate this. If I can do this with one click of the mouse, I'll be smiling! Thanks!!!

dwburman
03-10-2011, 10:01 PM
Can you post a pic of the model... or the model file itself?

Paul_Boland
03-15-2011, 09:26 PM
Can you post a pic of the model... or the model file itself?

Sorry, I can't post the model file, it's for a personal project, but here's some renders...

http://www.iol.ie/~pkb/AstroBots%20Titan%205%201.jpg

http://www.iol.ie/~pkb/AstroBots%20Titan%205%202.jpg

http://www.iol.ie/~pkb/AstroBots%20Titan%205%203.jpg

http://www.iol.ie/~pkb/AstroBots%20Titan%205%204.jpg

And you can view a movie of it here:
http://www.youtube.com/watch?v=Iv50TyGZR54&feature=channel_video_title

Lamont
03-16-2011, 06:19 AM
Create UVs (projection doesn't matter) > UV/Texture > Poly Map> New Quad Polygon Map.

Also, someone wrote a script that will orient them all the same. I think it's 32bit only. I will look for it and post since FLay is no more.

jeric_synergy
03-16-2011, 12:19 PM
Sorry, I can't post the model file, it's for a personal project, but here's some renders...
y'know, this is backwards: if it's personal you can do whatever you like with it. If it's commercial you are usually contractually restricted.

Paul_Boland
03-16-2011, 03:18 PM
I decided just to go with a full colour fill for the windows in the end. Looking at the list of ships I need to create for AstroBots, and the thoughts of having to set up UV's for them all, I felt this was the best way to go. It works fine for what I want, thanks though.


y'know, this is backwards: if it's personal you can do whatever you like with it. If it's commercial you are usually contractually restricted.

;)

VirtualFM
03-16-2011, 06:04 PM
I decided just to go with a full colour fill for the windows in the end. Looking at the list of ships I need to create for AstroBots, and the thoughts of having to set up UV's for them all, I felt this was the best way to go. It works fine for what I want, thanks though.


If you are taking this decision because of design or because you really want to, then OK.

If you are taking this decision because you are compromising and thinking it will be lots of work and troublesome you are either:
a) wasting precious advice
b) not understanding how easy this is

Because you have 3 incredible easy solutions already here... well, 2.5 solutions!
1 - jeric_sinergy solution is perfectly feasible. It doesn't take much time to do that manually, just drag all window-corners to UV-Space corners and all is well! 10 minutes is a long time. You could do a ton of windos with this method. The windows of your model? Takes one minute, maybe 2.
2 - The texturing method you are talking about is called "Cubic", if it's what I am thinking of. It's very easy to apply: just choose "Cubic" instead of "Planar/Cylindrical/Spherical/etc". This almost works, depending on your model. You may need some tweaking, or maybe try to use a "control polygon" for texture sizing/positioning. That's why I call it an "half" solution.
3 - Sensei and Lamont have the solution (UV approach - use Maps > Polygon Maps > New Quad Map). It's flawless, and you take some seconds to solve your problem.

So, if after this you decide to "make the windows a solid color" it better be because of aesthetic/design reasons!

jeric_synergy
03-16-2011, 06:11 PM
Because you have 3 incredible easy solutions already here... well, 2.5 solutions!
1 - jeric_synergy's solution is perfectly feasible. It doesn't take much time to do that manually, just drag all window-corners to UV-Space corners and all is well! 10 minutes is a long time. You could do a ton of windos with this method. The windows of your model? Takes one minute, maybe 2.
Yeah, and I only suggested it because I had forgotten about Quad mapping!

Paul_Boland
03-16-2011, 08:54 PM
Ok, that's me put in my place! LOL!! Yous have my word, tomorrow I will attempt the suggestions here to apply the texture to the windows of the Titan. Truth be told, I would much rather have textured windows but if it's too much work, I'm happy to run with solid colour windows. I'll let yous know how it turns out...