当前位置导航:炫浪网>>网络学院>>图形图像>>MAYA教程

用maya制造环形跑道模型和材质(英文)

Part One

Racetrack environment creation has been my staple diet for the last eighteen months as I have been working on Total Immersion Racing, at Empire Interactive’s Razorworks studio based in Oxford. Razorworks, renowned for their Apache helicopter flight simulations on the PC, decided to take simulation into the racing genre, albeit with an arcade twist. The result is a multi-platform racing game containing real licensed GT cars and a number of racetracks, both real and fictional.

I joined the company at the early stages of development and have focused soley on track design and creation. For TIR I helped to develop two real circuits, which required a keen eye for real world accuracy, plus two invented circuits where I could let my imagination flow a little!

This tutorial concentrates on the processes involved with geometry construction and texturing of a typical polygonal racetrack environment that could be run within the TIR game engine. During the development of the game, it became clear that we were generating our own in-house style for the track creation, and many of the stages you see here are the result of hours of refinement to streamline the process. The track itself is one that unfortunately did not make it to the final build of the game but is a simple example that is useful to show track building techniques.

CREATING THE BUILD CURVES


(1) Seeing as the overall track distance is in kilometers, the first step is to set the units within Maya to meters. This is found in the Settings tab of the Preferences Options, found in the Window menu. Then import the track design in the top view as an image plane, which can be accessed in the top view’s View menu.

Click here to access the track design as seen in the screenshot above

(2) Using either the EP or CV NURBs tools set to a 3 cubic curve degree, trace the centreline of your track starting at the point where you would expect the start/finish line to be, usually opposite the pit lane. When completed, do not join the start and end points of the curve – overlap them slightly.


(3) Depending on your skills at drawing NURBs curves, you may need to modify the CVs or EPs on the curve. Try not to have any turns that are too sharp and make sure the curve is smooth and consistent. You may need to delete points or add more using the Insert Knots Tool.

(4) Use the Arc Length Measure Tool found in the Create menu and position it along the curve until you reach the overlapping end point. This is the distance of the circuit in metres and depending on your original image scale could be large or small.

(5) Scale the curve, up or down, until the arc length value is about 3840 then snap the end point to the start point of the curve. The total circuit length will then be approximately 3.84Km. Notice how this value is a multiple of 2 – you will see why I have chosen this later.


(6) Add height to the track by moving the CVs in the Y axis – made easier by selecting in the top view and moving in a side or front view. Notice in the track design, a 30 metre maximum height difference of the two small downhill sections, and the longer sweeping uphill.

(7) Offset Curve 3 times either side of the centreline. The track width will be 13m so offsetting four lines +6, -6, +6.5, -6.5, will compensate for the edge of the tarmac and the white line. Then offset twice again +9.5, -9.5 that will act as the outer edge of the grass verge.



(8) Again using the Arc Length Tool mark out the centreline approx. every 128m. Notice how I chose 3.84km as the track length. This will ensure that the circuit has 30 sections of 128m. This simplifies the modelling for purposes of this tutorial.


(9) In the top view, use a 1 cubic curve, and mark out lines perpendicular to the centreline positioned at every 128m marker. Then select all curves in the top view and Cut Curves selecting in the options box, to cut At All Intersections and keep All Curve Segments.

REBUILDING, LOFTING, TEXTURING

(10) In areas on the track where there are severe turns, like at a chicane, you may wish to fine tune the 128m sections by splitting them again into smaller sections of 32m, 64m, or 96m. This will make the eventual spans cleaner as shown in the image above.

(11) Select all the 128m curve sections and choose Edit Curves – Rebuild Curves with settings set to Uniform, 3 cubic degree and 32 spans. On the smaller sections simply modify this to suit, e.g a 32m section would have 8 spans. This will give the final polygon sizes a width of approx. 4m.

(12) In racing games found on next generation consoles, due to the increase in polygon usage, racing circuits look smooth around corners and not too jagged. You can smooth out curvy sections of the track double the spans when rebuilding, e.g. 32m curvy section would have 16 spans.


(13) At this point you should now have all the relevant curves in which to create some surfaces! At this point is a good idea to start organising your workflow. My favourite way is using Maya’s layers found in the Layer Editor. Set up a new layer called “curves” and add the curves to the layer.

(14) Moving around the track select the two curves that make up each surface and use the Loft command found in the Surfaces menu to create a lofted NURBs surface. Always select the curve on the right first to ensure the correct surface direction. Turning on backface culling in the viewport Shading menu will help.


(15) Now we have 3 types of surface, so we need the textures to fit the surfaces that all join together smoothly. For this create a tarmac texture (256x256pixels), a white line on tarmac texture (16x256), and a grass with tarmac edge texture (128x256). The textures all need to join together with no seam, and be tileable vertically.

(16) In the Hypershader create three lambert shader groups using the 3 textures. In the Place2dTexture node change the V repeat value to 16. This will ensure that per 128m surface section, the texture will tile 16 times – in other words each texture will cover two spans on the surface in the V direction.


(17) But what about the other sections of 32m, 64m, and 96m? Simple – just create three duplicates of each shader group and change the repeats to 4, 8, and 12 respectively. Its useful to use a naming convention for each so its easy to differentiate, e.g. Tarmac16, Tarmac12, Tarmac8 and Tarmac4.

(18) The next step is to assign each shader to the relevant sized surface. At this point you may need to use the Reverse Surface Direction Options found in the Edit NURBS menu. Alternatively you can modify the UVs later once the NURBs have been converted to polys.


ADDING ENVIRONMENT

(19) Time to convert to polygons at last! Use the Convert NURBS to Polygons Options found in the Modify menu. Make sure the Type is set to Quads, Tesselation Method is set to General, and the Initial Tesselation Controls are set to Per Span 1 of Iso Params.


(20) The new polygon surfaces should match one to one between polygon and surface span. At this point hide the NURBs surfaces away in a layer. Select all the polygon objects and combine them all, also merging the vertices using the tools in the Polygons, and Edit Polygons menus. You now have the completed polygonal track ribbon!

(21) Building the track in such a modular way gives a major advantage, in retaining the correct UVs. A good example of this is adding track edge kerbing on corners. Simply using the grass verge texture, and add some kerbs down one side. Et voila, when the texture is assigned to the polys it tiles beautifully!


(22) If you require any height tweaking – usually the result of playtesting the circuit, this can be added using the Wire Tool found in the Deform menu. This is especially useful if you want to add camber. Make the track ribbon Live by selecting the red magnet button and draw on two curves either side of the track making sure you start and end the curves a good distance from the area you wish modified.

(23) Use the Wire Tool and make sure you increase the dropoff distance so that the tool actually has an effect. Modify the the two curves by raising and lowering the points, remember not to stray too near the end points or you may result in polygons displacing too much. One good way is using the side or front views to modify so you can see the smoothness of the curve.


(24) To create the run off areas – usually in the form of sand traps on most race circuits, you can either extrude the edge of the polygons, or go back to the original NURBs and offset a further distance. It doesn’t matter if the shape seems weird as you can trim down the polygons later. This technique will already have the UVs in place so you could create a nice raked effect.

(25) Most racetracks have some kind of armco barrier system. The best way to handle this is to create a perfect set of barriers from your original NURBs curves and tweak their positioning later. You may need to rebuild the smaller sections that you originally smoothed out to have less spans so they match the 32 spans in the 128m sections. Using the curves you can extrude polygon surfaces.


(26) Combine all the barrier polygons, an apply a front barrier shader group to them with repeats set to 16 U, and 3 V. Then duplicate the polygons and reverse the normals and apply a rear barrier shader group with the same settings. Barriers should now snake around the track.

(27) Now you have created the most complex part, you can fill in the gaps. You can either build the polys seperately using Append to Polygon, or perhaps extrude edges. Or on a larger scale use tools like the Fill Tool found in the Edit Polygons menu to fill large holes which you can split up or triangulate so you can sculpt the polys by moving around the poly components.

相关内容
赞助商链接