Stadium in an Urban Landscape

Michal Moc, Stadium in an Urban Landscape Transferring Data from AutoCAD to Maya

In this article I describe a job, done for a third party, whose purpose was to visualize an idea. In this case it was a study of the planned placement of a stadium in an urban landscape.

 

I have started with various inputs, ended up with a single picture [pict1]. For my work I needed different maps, both raster images and a CAD drawing. The software that I utilised, in the order of usage was: AutoCAD, Maya 7.0 and Photoshop.

Picture1:
Picture 1

Stage 1: AutoCAD preparation

I started the work by creating the surrounding buildings.

Maps

For any real life work you will obtain your data from an appropriate institution. The data is generally created by some CAD or GIS application. You will usually receive DXF or DWG files with a ground plan of the area you are supposed to be working on, as well as many other pieces of graphical information. Consider it more a semi-finished product than a finished piece and go straight to Maya. [pict2]

Picture2:
Picture 2

One of the things you need, and you can sometimes also find it in your obtained CAD drawing, is a layer with a satellite picture, coordinated with your ground floor data. Other times it will be an extra picture file that you will have to coordinate (position, scale and rotate) yourself.

The easiest way to do this is to insert the satellite picture as a reference in ACAD. Choose one point (X) on the map, that you can also precisely locate in your DWG file. The best way is to use a corner of a large building or beginning of a road. Move the picture underneath, so the two maps match each other at this point. Now you can rotate and scale the picture, with the base point in (X) using a suitable reference (the other corner of the building, end of the road). [pict3]

Picture 3:
Picture 3

The maps should now exactly match each other. If not, just try it one more time with another reference point(s) until both maps are alligned. [pict4]

Picture 4:
Picture 4

Polylines

Now it’s time for the “polyline work”. Because most of the buildings you see basically have the ground floor shaped as an polygon, we will be using polylines. It is one of the simplest ways to transfer shapes from 2D CAD to Maya and build a 3D model consecutively. In your drawing there will usually be many different lines, in many different layers. You only need the basic outer shape. So let’s create our own layer, best using the color red, and lock the other layers. If you can definitely distinguish what is ground floor, then you can isolate this layer. Start drawing your red polyline over the existing lines, redrawing the outer shape of all the buildings. In order to maintain the order and finally acquire proper results, always start in the “upper left” corner of the buildings’ ground floor and continue CCW and close the polyline [pict5] (although it will not be closed when transferred into Maya).

Picture 5:
Picture 5

When done with all the surrounding buildings, do the same with your satellite map image – draw a polyline around the edge of the map object in AutoCAD.

Export

You have to be sure that you have the right working units set in the drawing. Now, export only your newly created polylines to a new DWG file. Otherwise you will end up with a mess of layers in Maya. So what you now have is a clean drawing with the simple shapes of all the surrounding houses and also the edge of the satellite picture. [pict6]

Picture 6:
Picture 6

Stage 2: Maya

Setting up the import

Setup Maya (in Settings) so that the Up axis is Z, the way AutoCAD is handling coordinates. The same working units must also be set as they were in ACAD. [pict7]

Picture 7:
Picture 7

Finally dwgTranslator.mll must be loaded (checked load in Plug-in Manager).

Now we will go to the Import dialog (in File menu) and select DWG_DXF in File Type, check Group in General Options and choose your working units. [pict8]
Picture 8:
Picture 8

It is time to import the “clean” DWG drawing previously created in ACAD.

Now move and scale the imported group of curves to your preferred position and size (If you cannot see the lines, change Far Clip Plane in cameras’ Attribute Editor). I would recommend moving the object pivot point to some “important” or “interesting” spot, that is unique for the project and then moving the whole group to the origin [0,0,0]. [pict9]

Picture 9:
Picture 9

Plateau

This is where we start building the first 3d object -a plateau for the model.

We already have an edge imported, what remains is to create Polygonal planar trimmed surface, with Linear degree, Tessellation method – Control Points. Assign a new Lambert material to it, connect the image of the satellite map to the Color Channel in Attribute Editor. The object with the map and the imported curves should match. [pict10]

Picture 10:
Picture 10

Heights- reference height:

For this part it is good to know what the place you are working on in virtual reality looks like in real life. Another possibility is to have a photo that is taken from the ground perspective. This can also give you enough information. What you need to know is the height of one of the objects. You can measure it either yourself in reality or judge from the photo by using some comparison.

Let’s say there is a house that you know of, where you know the precise position and real height.

In Maya create a simple Line (degree 1, in Z direction) starting on a plateau level up to the height of the house. Position it (best using Curve Snap) on the start of the imported polyline corresponding with the ground floor of the house. [pict11] You can also use one height for more objects.

Picture 11:
Picture 11

The sun:

In the satellite image you’ll see shadows of buildings. We will use its lengths to get the heights of the other objects.

Set up a Directional Light, that can later be used as a source of light, casting shadows in the same direction as in the satellite picture. Using Look through selected (in panels menu) for the directional light, you can precisely match the vertical line representing the known height of the house with the edge of its fallen shadow. [pict12]

Picture 12:
Picture 12

Call this light “lghtTheSUN”. Lock the rotation of the camera that it is connected to the light, so that you don’t accidentally rotate this camera.

Now start creating the heights of the other houses – first point at the corner of the ground floor and move the second point in Z direction, so that it matches the shadow of the house. [pict13]

Picture 13:
Picture 13

When you have finished with the heights of all the buildings, we will start to “grow” the houses using a fairly simple MEL script.

Stage 3: MEL script

Setting up:

It is necessary to create material for the surrounding houses, which we will call matGreyGlass.

In the Surface –> Extrude dialog set up these options: Tube, At profile, Component, Profile Normal, Complete, Polygons, Control Points. [pict14]

Picture 14:
Picture 14

In the Merge Vertices Options dialog set up Distance to something like 0.001.

In the Polygon Soften Harden Edge Options dialog set Angle to 0 (All Hard).

Create an empty Group called OBJ_surroundig_HOUSES, under which all the created houses will be parented.

Now write this in Script Editor:


Extrude;

PolygonSoftenHarden;

MergeMultipleEdges;

FillHole;

hyperShade -assign matGreyGlass;

select -add OBJ_surroundig_HOUSES;

Parent;

 

 

You must watch out here for the upper/lower case. And, of course, for ease of use, it is nice to map the script under a Hotkey.

Using the script:

Now we will “grow” the houses one by one. First let’s select the ground floor curve (formerly the red polylines in ACAD), then the corresponding height and press the hotkey you have assigned the script to.

The script makes a simple polygonal cube (or a more complex shape) with the right height, creates a cap (by using FillHole), assigns certain material, and parents it in the OBJ_… Group.

This only creates flat roofs – if you desire a gabled roof, just split the top cap in the middle and then move the edge a little higher.

This finalises creating the surrounding buildings.

 

Stage 4: The STADIUM

Modeling

Modeling the stadium is a simple task using “traditional” modeling techniques. For the exact placement and shape you can also import AutoCAD curves and then let them create the desired shape of the object. the level of detail depends on the distance from the camera.

Stage 5: Rendering and post production

Before I started rendering I edited the original satellite picture image by adding some extra trees and parking spaces in the area around the Stadium.

Rendering

For rendering I used different light situations for different groups of objects (so that the lights do not interfere), and thus creating more images for one camera.

Post production

The final image was composed out of the different images rendered separately, and a little bit of brushing up was also needed (e.g. too much fog in some places).

Summary

This was a brief description of the process of transferring the “raw” AutoCAD data into something more “juicy” that you can present to your client. There are a few small glitches that can from time to time occur, but persistency and sometimes little bit of MEL slickness can lead you to the desired and artistic result. Good luck!

Picture 15