4. UV-mapping

First, a bit of basic education.

As you may know, here we use meshes, that is, models defined by the position in space of their points and faces. The faces make up the surface of this model. Any face can be split into elementary triangles, which are the elementary faces. In practice, in the projection window CarCAD we see that the model's surface consists of triangles. Knowing how to color each of these triangles, we know how to color the whole model. But how do we define the coloring of these triangles? The suggestion to make an "unfold" of the whole model onto a plane and color it there is out – because it's incredibly difficult (and in most cases simply impossible ;-). So, for our convenience, Electronic Arts made it so that a triangle on the texture doesn't necessarily have to be equal or similar to the triangle on the model – the image from the texture will be stretched/compressed accordingly. Let me explain with an example:

The same three-dimensional triangle and the corresponding triangles on the texture.

(Still don't get it? Never mind, read it about five times, and then suddenly you'll understand. ;-) We'll figure it out on the spot %-).

So, as a texture we can now use any views of the car that are convenient for us. And convenient for us, naturally, are views like the projections – right, left, front, back, etc.

Initially CarCAD offers us the following arrangement of views:

     0 Side – from the side;
     1 Top – from above;
     2 Bottom – from below;
     3 Front – from the front;
     4 Back – from the back;
     5 Wheel – wheel from the side;
     6 Other – everything else.
The arrangement can be changed, but that's not important right now.
Click the button UV.

You can see that right now all the car's triangles are located on the texture in the Side zone, i.e. on the side view. You can, of course, leave it like that by creating just one view on the texture, but then in certain places the texture will be horribly smeared (example on the right) ;-)


Our task is to spread the triangles across the remaining views so as to avoid, as much as possible, strong compression/stretching of the texture on them. It's clear, for example, that the triangles of the roof and hood should be located on the top view, the triangles of the wheels – on the corresponding view, etc. – so that there are no big distortions.


Let's get started. Reload CarCADto get rid of the texture, switch to triangle editing mode (Edit/Triangle Editor) and open the UV Remapper panel on the right.

Remove all parts from the screen except one so they don't get in the way, then click in the projection window (UV we don't need it yet) on some triangle (they are highlighted by a red dot in the center), then on another. This ritual is mandatory, otherwise when you try to select many triangles at once, CarCAD will crash. Preparation is complete.

Look at the panel UV Remapper. There's the familiar list of views – side, front, back, etc. To match a triangle on the model with a triangle on the texture, you need to: click on this triangle and in the view list in the panel select the view on the texture where this triangle should appear. Since this is an idiotic method, ;-) (clicking on each of 2000 triangles???), the program's author provided us with the option lock. If you check the Lbox, then ALL triangles that we select in the projection window will be assigned to the view currently selected in the list. For greater convenience, there's this feature – you can make CarCAD not show triangles assigned to a particular view. This is controlled by the checkboxes 1-7.

In the projection windows the triangles differ by color. Thus, triangles assigned to the view 1 Sideare marked in gray;
to the view 2 Top – in black;
to the view 3 Bottom – in blue;
to the view 4 Front – in green;
to the view 5 Back – in light blue;
to the view 6 Wheel – in red;
to the view 7 Other – in purple.

It is recommended to proceed as follows: initially all triangles are gray, i.e. assigned to the view Side. Disable all other views except 1 (uncheck them) and roughly distribute the triangles among the views by selecting them with a frame. Those already assigned will disappear and not get in the way. For example, you can immediately assign the whole roof and hood with a margin to "top", to "front" – what's left of the front end and the windshield, to "back" – the rear door, etc. Then, by alternately enabling other views and disabling the rest, correct the mistakes. Here you can also use zoom (+/-) and scrolling (Pg Up, PG Dn, Home, End).

     
What's left after the rough distribution in the view Side.

     
After the rough distribution in the view Bottom. You can see there are extra triangles that should belong to the view Side. We correct them, and so on, through all the views...


     

Here's the result. To save these correspondences, click save in the panel UV Remapper. Since this is information of the CarCADprogram and not of the FCE format, it is saved separately (in a file with the .uv extension), and to restore it later, you will need to specifically load it with the button Load from the panel.

Now switch to UV and click REMAP. Hooray! There's a body texture.

We repeat the same with all the remaining parts. The wheels entirely belong to the view Wheel, the interior can be fully assigned to Other.

Problem: the interior doesn't look the way we'd like. It would be desirable to make a top view for it, but a side view was obtained. Solution: let's change the view itself. Click Edit in the panel UV. You will see all the views. Select Other and instead of ZY set its orientation to ZX, like the view Top.

As for the other settings: X, Y – this is the position of the given view, W, H – its dimensions.
Rotate – whether to rotate the view by 90 degrees.
Normal, Wheel, Symmetry – heaven knows... ;-) let me know if you know, this is only a beta version of the guide after all...
Again Remap and now the interior looks decent.



Here's the texture we ended up with.

However...what about the driver? There's room on the texture – for example, in the side view above the hood or under the wheels. That's where we'll stuff him now.

Just in case, so as not to lose the results of our work, we save, click save in UV remapper, then we save the FCE under a new name and click again save. Nothing funny about it, without Undo people become even bigger paranoids... ;-)

Now we call Edit of views and move the view Other approximately to the area of the rear wheel of the "side" view on the texture, change the orientation to ZY (this is for the driver's head). The view Bottom – to the place above the hood (this is for the driver himself), and also change the orientation to ZY.

Then we assign the head to the view Other, and the driver – to the view Bottom.

Now ATTENTION! Remap "remaps" only the selected parts, but at the same time for these parts all information about the correspondence of the model's triangles to the texture is completely replaced. Therefore, uncheck the boxes in the panel Parts for all the parts that are already done, except the driver, and only then press Remap.

Everything turned out too small for me, so I had to enlarge the views to about these sizes.

And here is the resulting texture.

We should shift the driver's images slightly. This can be done through Edit of views, or you can move them manually right on the texture. To do this, enable the point editing mode, select the needed points (by the way, there's a specific way of selecting here...you have to get used to clicking not on the point, but next to it ;-), and use the cursor keys to move them where needed. The selection is cleared, as before, with the D key.

So, UV-remapping (why it's called exactly that – that's a long story ;-) is finished and we have a draft of the future texture. Ideally, one should strive for maximum filling of the image... usually symmetrical parts are combined (and a wheel can, if desired, be squeezed down to a 30-degree slice ;-), and everything gets much more compact...but I'm too lazy to bother with that ;-)


CarCAD guide © Baco, 2001.

Comments

Do you agree with the author? Share your experience or correct us.

Reviews: 0
Sign in  or  sign up  Sign in or sign up to leave a comment.