Modeling – Geospatial Modeling & Visualization / A Method Store for Advanced Survey and Modeling Technologies Thu, 22 Mar 2018 11:41:42 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 Assessing your 3D Model: Effective Resolution /scanning/hardware/leica-c10/assessing-your-3d-model-effective-resolution/ Fri, 22 Feb 2013 14:17:08 +0000 /?p=12077 Continue reading ]]> [wptabs mode=”vertical”] [wptabtitle] Why effective resolution?[/wptabtitle] [wptabcontent]For many archaeologists and architects, the minimum size of the features which can be recognized in a 3D model is as important as the reported resolution of the instrument. Normally, the resolution reported for a laser scanner or a photogrammetric project is the point spacing (sometimes referred to as ground spacing distance in aerial photogrammetry). But clearly a point spacing of 5mm does not mean that features 5mm in width will be legible. So it is important that we understand at what resolution features of interest are recognizable, and at what resolution random and instrument noise begin to dominate the model.

Mesh vertex spacing circa 1cm.

Mesh vertex spacing circa 1cm.


[/wptabcontent]

[wptabtitle] Cloud Compare[/wptabtitle] [wptabcontent]
cc_logo_v2_small

cc_logo_v2_small

The open source software Cloud Compare, developed by Daniel Girardeau-Montaut, can be used to perform this kind of assessment. The assessment method described here is based on the application of a series of perceptual metrics to 3D models. In this example we compare two 3D models of the same object, one derived from a C10 scanner and one from from a photogrammetric model developed using Agisoft Photoscan.[/wptabcontent]

[wptabtitle] Selecting Test Features[/wptabtitle] [wptabcontent]

Shallow but broad cuttings decorating stones are common features of interest in archaeology. The features here are on the centimetric scale across (in the xy-plane) and on the millimetric scale in depth (z-plane). In this example we assess the resolution at which a characteristic spiral and circles pattern, in this case from the ‘calendar stone’ at Knowth, Ireland is legible, as recorded by a C10 scanner at a nominal 0.5cm point spacing, and by a photogrammetric model built using Agisoft’s photoscan from 16 images.

C10 and Photoscan data collection at Knowth, Ireland[/wptabcontent]

[wptabtitle] Perceptual and Saliency Metrics[/wptabtitle] [wptabcontent]

Models from scanning data of photogrammetry can be both large and complex. Even as models grow in size and complexity, people studying them continue to mentally, subconsciously simplify the model by identifying and extracting the important features.

There are a number of measurements of saliency, or visual attractiveness, of a region of a mesh. These metrics generally incorporate both geometric factors and models of low-level human visual attention.

Local roughness mapped on a subsection of the calendar stone at Knowth.

Local roughness mapped on a subsection of the calendar stone at Knowth.

Roughness is a good example of a relatively simple metric which is an important indicator for mesh saliency. Rough areas are often areas with detail, and areas of concentrated high roughness values are often important areas of the mesh in terms of the recognizability of the essential characteristic features. In the image above you can see roughness values mapped onto the decorative carving, with higher roughness values following the edges of carved areas.

[/wptabcontent]

[wptabtitle] Distribution of Roughness Values[/wptabtitle] [wptabcontent]The presence of roughness isn’t enough. The spatial distribution, or the spatial autocorrelation of the values, is also very important. Randomly distributed small areas with high roughness values usually indicate noise in the mesh. Concentrated, or spatially autocorrelated, areas of high and low roughness in a mesh can indicate a clean model with areas of greater detail.

High roughness values combined with low spatial autocorrelation of these values  indicates noise in the model.

High roughness values combined with low spatial autocorrelation of these values indicates noise in the model.

[/wptabcontent]

[wptabtitle] Picking Relevant Kernel Sizes[/wptabtitle] [wptabcontent]

To use the local roughness values and their distribution to understand the scale at which features are recognizable, we run the metric over our mesh at different, relevant, kernel sizes. In this example, the data in the C10 was recorded at a nominal resolution of 5mm. We run the metric with the kernel at 7mm, 5mm, and 3mm.

Local roughness value calculated at kernel size: 7mm.

Local roughness value calculated at kernel size: 7mm.

Local roughness value calculated at kernel size: 5mm.

Local roughness value calculated at kernel size: 5mm.

Local roughness value calculated at kernel size: 3mm.

Local roughness value calculated at kernel size: 3mm.

Visually we can see that the distribution of roughness values becomes more random as we move past the effective resolution of the C10 data: 5mm. At 7mm the feature of interest -the characteristic spiral- is clearly visible. At 5mm it is still recognizable, but a little noisy. At 3mm, the picture is dominated by instrument noise.
[/wptabcontent]
[/wptabs]

]]>
Working with the Vue interface with Python /modeling/working-with-the-vue-interface-with-python/ Thu, 04 Oct 2012 16:15:52 +0000 /?p=11575 Continue reading ]]> [wptabs style=”wpui-alma” mode=”horizontal”] [wptabtitle]Passing arguments[/wptabtitle]
[wptabcontent]
The snippet below launches Vue from a Python script and passes in two arguments to Vue, ARG1 and ARG2:

import subprocess
command = [r"C:\Program Files\e-on software\Vue 10.5 Infinite\Application\Vue 10.5 Infinite", "-p'D:\\Temp\\bat-test.py' ARG1 ARG2"]
result = subprocess.Popen(command)


[/wptabcontent] [/wptabs]

]]>
Working with objects in Vue with Python /modeling/working-with-objects-vue-python/ Thu, 04 Oct 2012 16:13:58 +0000 /?p=11527 Continue reading ]]> [wptabs style=”wpui-alma” mode=”horizontal”]
[wptabtitle]Get the size of an object[/wptabtitle]
[wptabcontent]Getting the actual size of an object in Vue programmatically isn’t as easy as you’d think. You essentially have to get the BoundingBox of the object and work with that. So here we have a wind turbine object, and we have selected the pole and need to know (programmatically) how tall this pole really is.

wind turbine object in Vue

If you look at that z-value in the size properties, you see that it’s 76.045m tall. To get that height programmatically (result on line 21):

#
#
>>> col = GetSelectedObjectByIndex(0)
>>> col
>>> scale = col.GetScale()
>>> print scale
(1.0, 1.0, 1.0)
>>> bb = col.GetBoundingBox()
>>> print bb
<VuePython.VUEBoundingBox; proxy of <Swig Object of type 'VUEBoundingBox *' at 0x0000000017884360> >
>>> print bb.GetMax()
(4024.3647753980426, -9026.798040135702, 216.7754350035159)
>>> print bb.GetMin()
(4019.764775016573, -9031.39804242452, 140.730600866553)
>>> 

# Do the math

>>> z_size = bb.GetMax()[2] - bb.GetMin()[2]
>>> print z_size
76.044834137
>>> 

# Make a dict out of em

>>> d = {}
>>> d['Min'] = bb.GetMin()
>>> d['Max'] = bb.GetMax()
>>> print d
{'Max': (4024.3647753980426, -9026.798040135702, 216.7754350035159), 'Min': (4019.764775016573, -9031.39804242452, 140.730600866553)}
>>>
>>> print d['Max'][2]
216.775435004
>>>
#
#

 
[/wptabcontent]
[wptabtitle] Multiple cameras[/wptabtitle]
[wptabcontent]
Turns out there is no Python method in the Vue API for creating a camera. In order to create cameras, you can duplicate the Main camera and then call your custom cameras by index, where the index is the ID number of the camera.

#
#
# Dict of KOPs and attributes
# {KOP ID: (northing, easting, cam z position, FoV,    
#           camera yaw, camera pitch,  sun pitch, sun yaw)}
d = {5: ('15980.6638981', '6893.65640636', '3.7', 'Center', 
         '344.064664362', '93', '116.821439116', '120.778962736'), 
     6: ('8647.62696908', '27858.4046614', '3.7', 'Center', 
         '283.801779018', '93', '116.693562607', '120.534961058')}

# Create new cameras by duplicating Main camera for each KOP
for k in d.iterkeys():
    sc = SelectByName("Main camera")
    camera = GetSelectedObjectByIndex(0)
    Duplicate()
    DeselectAll()

# Set start position to 2, as its zero based indexing and Main camera is 0, 
#  Top camera is 1, so our first custom camera will be 2
cam_start_pos = 2

# For each pair in kop dict, map it to a new dict, where key is camera 
#  index and value is kop dict kv pair
#  {2:{'5': ('15980.6638981', '6893.65640636', '3.7', 'Center', 
#            '344.064664362', '93', '116.821439116', '120.778962736')},
#   3:{'6': ('8647.62696908', '27858.4046614', '3.7', 'Center', 
#            '283.801779018', '93', '116.693562607', '120.534961058')}}
i = 2
cams_kops = {}
for k, v in d.iteritems():
    cams_kops[i] = dict([(k, v)])
    i+=1
  
# Get the kop id (its a dict key) for a given camera id
cams_kops[2].keys() # 5

# Setup the camera for each KOP
select_camera = SelectByName("Main camera")
for k, v in cams_kops.iteritems():
    if SwitchCamera(k):  # k is camera id
        #kop_id = cams_kops[k].keys()[0]
        kop_attributes = cams_kops[k].values()[0]        
        camera = GetSelectedObjectByIndex(0)
        camera.SetPosition(float(kop_attributes[1]), 
                           float(kop_attributes[0]), 
                           float(kop_attributes[2]))
        Refresh()
        camera.SetRotationAngles(float(kop_attributes[5]), 
                                 0, float(kop_attributes[4]), true)
        Refresh()           
    else:
        # raise exception
        print "No"
        
    i+=1
    
# Create KOP/camera dictionary {KOP:camera id, ..} to associate each
#  KOP with its camera
kop_camera_ids = {}
for camera_id, kop_id in cams_kops.items():
    kop_camera_ids[kop_id.keys()[0]] = camera_id
    
print kop_camera_ids

SwitchCamera(0) # Activates "Main camera" again

# Now to switch the camera to a known KOP ID's camera, just do:
SwitchCamera(kop_camera_ids[6]) # call camera by the KOP ID
#
#

This results in two new cameras, Main camera0 and Main camera1. The names of the cameras in the layer list are pretty much meaningless since you access them via index.

And here is what they look like from the Top view:

[/wptabcontent]
[wptabtitle]Add an array of cylinders[/wptabtitle]
[wptabcontent]
We needed to test and make sure that, when using a planetary sphere in Vue, objects are indeed placed on the curvature of sphere (in our case, the Earth). The following script adds a cartesian-like array of cylinders into a Vue scene. First we need to create the cartesian array of points:

import itertools
d = {}
count = 1
for i in itertools.product([0,100,200,300,400,500,600,700,800,900,1000],
                           [0,-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000]):
    d[count] = list(i)
    count += 1

Which gives us a dictionary of key/value pairs where the key is an id number and the pairs are the X/Y cartesian coordinates, spaced 100 units apart in the X and Y:

for each in d.items()
    print each

(1, [0, 0])
(2, [0, -100])
(3, [0, -200])
(4, [0, -300])
(5, [0, -400])
(6, [0, -500])
(7, [0, -600])
(8, [0, -700])
(9, [0, -800])
(10, [0, -900])
(11, [0, -1000])
(12, [100, 0])
(13, [100, -100])
(14, [100, -200])
(15, [100, -300])
(16, [100, -400])
(17, [100, -500])
(18, [100, -600])
(19, [100, -700])
(20, [100, -800])
(21, [100, -900])
(22, [100, -1000])
...
...
(111, [1000, 0])
(112, [1000, -100])
(113, [1000, -200])
(114, [1000, -300])
(115, [1000, -400])
(116, [1000, -500])
(117, [1000, -600])
(118, [1000, -700])
(119, [1000, -800])
(120, [1000, -900])
(121, [1000, -1000])

Now let’s add z-values to the X and Y lists so we have a height for each cylinder:

d2=d
for k, v in d2.iteritems():
    v.append(500)
    
for each in d2.items():
    print each
    
(1, [0, 0, 500])
(2, [0, -100, 500])
(3, [0, -200, 500])
(4, [0, -300, 500])
(5, [0, -400, 500])
(6, [0, -500, 500])
(7, [0, -600, 500])
(8, [0, -700, 500])
(9, [0, -800, 500])
(10, [0, -900, 500])
(11, [0, -1000, 500])
(12, [100, 0, 500])
(13, [100, -100, 500])
(14, [100, -200, 500])
(15, [100, -300, 500])
(16, [100, -400, 500])
(17, [100, -500, 500])
(18, [100, -600, 500])
(19, [100, -700, 500])
(20, [100, -800, 500])
(21, [100, -900, 500])
(22, [100, -1000, 500])
...
...
(111, [1000, 0, 500])
(112, [1000, -100, 500])
(113, [1000, -200, 500])
(114, [1000, -300, 500])
(115, [1000, -400, 500])
(116, [1000, -500, 500])
(117, [1000, -600, 500])
(118, [1000, -700, 500])
(119, [1000, -800, 500])
(120, [1000, -900, 500])
(121, [1000, -1000, 500])

Finally, here is the script to run on a 1km planetary terrain scene within Vue:

d_100s = {1:[0, 0, 500],
          2:[0, -100, 500],
          3:[0, -200, 500],
          4:[0, -300, 500],
          5:[0, -400, 500],
          6:[0, -500, 500],
          7:[0, -600, 500],
          8:[0, -700, 500],
          9:[0, -800, 500],
          10:[0, -900, 500],
          11:[0, -1000, 500],
          12:[100, 0, 500],
          13:[100, -100, 500],
          14:[100, -200, 500],
          15:[100, -300, 500],
          16:[100, -400, 500],
          17:[100, -500, 500],
          18:[100, -600, 500],
          19:[100, -700, 500],
          20:[100, -800, 500],
          21:[100, -900, 500],
          22:[100, -1000, 500],
          23:[200, 0, 500],
          24:[200, -100, 500],
          25:[200, -200, 500],
          26:[200, -300, 500],
          27:[200, -400, 500],
          28:[200, -500, 500],
          29:[200, -600, 500],
          30:[200, -700, 500],
          31:[200, -800, 500],
          32:[200, -900, 500],
          33:[200, -1000, 500],
          34:[300, 0, 500],
          35:[300, -100, 500],
          36:[300, -200, 500],
          37:[300, -300, 500],
          38:[300, -400, 500],
          39:[300, -500, 500],
          40:[300, -600, 500],
          41:[300, -700, 500],
          42:[300, -800, 500],
          43:[300, -900, 500],
          44:[300, -1000, 500],
          45:[400, 0, 500],
          46:[400, -100, 500],
          47:[400, -200, 500],
          48:[400, -300, 500],
          49:[400, -400, 500],
          50:[400, -500, 500],
          51:[400, -600, 500],
          52:[400, -700, 500],
          53:[400, -800, 500],
          54:[400, -900, 500],
          55:[400, -1000, 500],
          56:[500, 0, 500],
          57:[500, -100, 500],
          58:[500, -200, 500],
          59:[500, -300, 500],
          60:[500, -400, 500],
          61:[500, -500, 500],
          62:[500, -600, 500],
          63:[500, -700, 500],
          64:[500, -800, 500],
          65:[500, -900, 500],
          66:[500, -1000, 500],
          67:[600, 0, 500],
          68:[600, -100, 500],
          69:[600, -200, 500],
          70:[600, -300, 500],
          71:[600, -400, 500],
          72:[600, -500, 500],
          73:[600, -600, 500],
          74:[600, -700, 500],
          75:[600, -800, 500],
          76:[600, -900, 500],
          77:[600, -1000, 500],
          78:[700, 0, 500],
          79:[700, -100, 500],
          80:[700, -200, 500],
          81:[700, -300, 500],
          82:[700, -400, 500],
          83:[700, -500, 500],
          84:[700, -600, 500],
          85:[700, -700, 500],
          86:[700, -800, 500],
          87:[700, -900, 500],
          88:[700, -1000, 500],
          89:[800, 0, 500],
          90:[800, -100, 500],
          91:[800, -200, 500],
          92:[800, -300, 500],
          93:[800, -400, 500],
          94:[800, -500, 500],
          95:[800, -600, 500],
          96:[800, -700, 500],
          97:[800, -800, 500],
          98:[800, -900, 500],
          99:[800, -1000, 500],
          100:[900, 0, 500],
          101:[900, -100, 500],
          102:[900, -200, 500],
          103:[900, -300, 500],
          104:[900, -400, 500],
          105:[900, -500, 500],
          106:[900, -600, 500],
          107:[900, -700, 500],
          108:[900, -800, 500],
          109:[900, -900, 500],
          110:[900, -1000, 500],
          111:[1000, 0, 500],
          112:[1000, -100, 500],
          113:[1000, -200, 500],
          114:[1000, -300, 500],
          115:[1000, -400, 500],
          116:[1000, -500, 500],
          117:[1000, -600, 500],
          118:[1000, -700, 500],
          119:[1000, -800, 500],
          120:[1000, -900, 500],
          121:[1000, -1000, 500]}
          
def get_object_size(vue_object):
    """ Takes a input Vue object, gets it's bounding box, then does the
        math to get the XYZ size of the object. Returns a X,Y,Z tuple of
        the object size.
    """
    bounding_box = vue_object.GetBoundingBox()
    bb_min = bounding_box.GetMin()
    bb_max = bounding_box.GetMax()
    # Build our tuple of object XYZ size
    object_size = (bb_max[0] - bb_min[0], bb_max[1] - bb_min[1],
                   bb_max[2] - bb_min[2])
    return object_size

i = 1
for k, v in d_100s.iteritems():
    AddCylinder()
    cyl = GetSelectedObjectByIndex(0)
    cyl.SetPosition((v[0]), (v[1]), v[2]/2)
    Refresh()
    # Get Z size of object
    orig_z = get_object_size(cyl)[2]
    print orig_z
    cyl.ResizeAxis(10, 10, (v[2])/orig_z)
    Refresh()
    DeselectAll()
    i += 1

And the end result is this:

Now, granted this isn’t the most practical script, but it does show how a little bit of work with itertools, dictionaries, and the Vue API lets you place a massive amount of objects into a scene relatively painlessly and quickly.

[/wptabcontent]
[/wptabs]

]]>
Unity Pro vs Unity Indie /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/unity-pro-vs-unity-indie/ Sat, 11 Aug 2012 11:53:42 +0000 /?p=11463 Continue reading ]]> Unity Indie is a free version of the Unity3D software. It allows anyone to use a modern advance game engine to create interactive realtime 3D visualizations for Windows, Mac, Web player and soon, Linux.

The chief differences between Unity Indie and Unity Pro lies in the ability to optimize your scenes and the ability to create scable worlds. Its significant to point out that most of these features in Unity Pro can be imitiated to a certain degree in Indie using code and modeling software.

[wptabs mode=”vertical”] [wptabtitle] Intro to Static Batching[/wptabtitle] [wptabcontent]Graphics cards can process many polygons with relative ease. The texture mapped onto those polygons tend to be the source of rendering and performance problems. Whenever you test out your Unity application by hitting play, Unity renders on screen everthing that is aligned with the camera (or view frustrum). Every object using a different material within the field of vision gets sent to the graphics card for processing. Unity does this in passes. Everything in the back is rendered first working its way to the front.
Every object getting sent one by one to the GPU is a fairly inefficient procedure. If there are a number of individual models pointing to the same material, Unity can combine these models at runtime reducing the amount of data that is sent to the GPU. Unity in effect renders or “draws” these combined meshes in one batch or “call”. Unity does this to some degree already with dynamic batching (included in the indie version). But the most significant gains come when you can tell Unity which models you’d like grouped together. This is where static batching comes in (only available in the Pro version).
[/wptabcontent]
[wptabtitle] Tag a Static Batch Object[/wptabtitle] [wptabcontent]When you tag an object as static batched, then Unity will group that object in with other objects that share the same material.

Go to Edit > Project Settings > Player

Check Static Batching


[/wptabcontent]

[wptabtitle] Specify the models[/wptabtitle] [wptabcontent]Now you’ll want to tell Unity which models should use static batching. Remember, static batching is only effective on models that share the same texture and material. Duplicates of objects and models using texture atlases are your prime targets.


[/wptabcontent]
[wptabtitle] Static Batching Statistics[/wptabtitle] [wptabcontent]
-Select a prefab in the Project panel or select a GameObject in the Hierarchy.

-In the top right corner of the Inspector, click on the triangle next to Static. A drop down menu appears. Select Batching Static. We’ll talk about some of the other static options in a moment.

-When you click play, you can see how many models are being batched at any given time by click on the Stats button in the upper right corner of the Game panel. You should see a decrease in the Draw Calls also when you enable Static Batching.


[/wptabcontent]
[wptabtitle] Introducing Occlusion Culling [/wptabtitle] [wptabcontent]I mentioned above that Unity renders everything in the back first and then everything towards the camera. This means that if you look at a wall in Unity everything behind that wall is getting rendered as well and affecting performance. This seems inefficient and impractical. You could have a sprawling city behind that wall and have it affecting your performance. This is where occlusion culling comes in.

Occlusion culling keeps track of what is visible from any given location via a 3D grid of cells called Potentially Visible Set (PVS). Each cells contains a list of what other cells are visible and which are not. Using this information, Unity can render only that which is visible significantly decreasing the amount of data that needs to be processed to render the scene.

Setting up occlusion culling is fairly straightforward, but keep in mind, depending on the scale of your scene, the baking process could take from 30 minutes to a couple of hours.
[/wptabcontent]
[wptabtitle] Setting up Occlusion Culling[/wptabtitle] [wptabcontent]1. Select all the stationary GameObjects
2. In the top right corner of the Inspector, click the triangle next to “Static
3. Select “Occluder Static”
4. Drag and drop your First Person Controller into the scene.
5. Now go to Window > Occlusion Culling

A new window opens called “Occlusion” along with a 3D grid in the scene view. The 3D grid represents the size of the cell grid the OC process will use. As it stands, the entire scene will be used in occlusion culling.

[/wptabcontent]
[wptabtitle] Bake Occlusion Culling[/wptabtitle] [wptabcontent]6. Click on the “Bake” tab. You’ll see the settings for the Occlusion Culling.

7. Click on “Bake” and go get some lunch. When the baking finishes, click Play and make sure you do not have geometry that suddenly appears and disappears. You can move the Game view so that it is adjacent to the Scene view. You can see how only the geometry you are viewing in the Game view is the only geometry visible in the scene view and whenever you rotate and move the geometry appears and reappears as needed. This should drastically reduce any frame rate issues. [/wptabcontent]
[wptabtitle] Introducing Lightmapping[/wptabtitle] [wptabcontent]When you have lights casting realtime shadows in your scene, the frame rate can be greatly affected as every pixel of an object reflecting light has to be calculated for the right affect and the shadows have to be calculated as well. Lightmapping is a process that “bakes” or draws the shadows and lighting effects onto the textures of an object so that at runtime no light calculations need to be processed. An additional advantage is also that lightmapping can add ambient occlusion to a scene that adds an element of realism and softness to the scene. The setup is similar to Occlusion Culling, but it can take even longer. This is very much an all night process, so be sure to start it before leaving the day, if the scene is large or uses many materials.

As with everything else, you must tag the objects you want to have a lightmap for.
[/wptabcontent]
[wptabtitle] Setting up Lightmapping[/wptabtitle] [wptabcontent]1. In the top right corner, click on the triangle next to “Static” and check “Lightmap Static”
2. Go to Window > Lightmapping
3. Click on the Bake tab. The settings for lightmapping appear and at first glance they are daunting. For most situations though, the default settings should do fine. The main thing to look for is to see that “Ambient Occlusion” is at least .4 if you want to add Ambient Occlusion to your scene.
5. Click Bake and call it an evening (depending on the scene size)


[/wptabcontent] [/wptabs]

]]>
Creating a Terrain in Unity From a DEM /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/creating-a-terrain-in-unity-from-a-dem/ Sat, 11 Aug 2012 11:31:55 +0000 /?p=11449 Continue reading ]]> Getting DEMs translated into a form Unity understands can be a bit tricky, and as of yet no perfect solution exists . Nevertheless, DEMs are excellent ways to acquire terrain and elevation models for a variety of purposes. Racing games created in Unity make extensive use of DEMs for levels as well as architectural visualizations. Beware though that accuracy tends to be an issue.

There are two main ways to translate DEM data into Unity. One way is to convert a DEM into a Raw heightmap. The other is to convert a GridFloat dem into a Unity terrain

[wptabs mode=”vertical”] [wptabtitle] Using Terragen/3DEM[/wptabtitle] [wptabcontent]The goal of this method is to convert the DEM into a RAW heightmap that Unity reads natively. For many users of Unity, the most cost effective solution is to use a two step rocess using Terragen and 3DEM, but if you can obtain a heightmap from DEM by any other means, you can skip to the Import into Unity section. [/wptabcontent]

[wptabtitle] Convert DEM to Terragen File[/wptabtitle] [wptabcontent]The first step is to convert the DEM into a Terragen file. We use the free program 3DEM, which you can download here.

1. Open 3DEM.
2. Choose the format of the DEM in question


[/wptabcontent]
[wptabtitle] Define the export area[/wptabtitle] [wptabcontent]3. Select an area you wish to export.

[/wptabcontent]

[wptabtitle] Extract the export extents[/wptabtitle] [wptabcontent]4. Here’s the tricky part. The selection box does not give us any information concerning the width, length and elevation of the selected area and Unity will need this information. We will have to point our cursor in severa spots inside the selection box to extract this data. When you move the cursor, the Northing, Easting and Elevation info appears in the lower right hand corner.

We can use this to extract the width of the selection box. If we point the cursor on the left edge of the box and then the right edge, we subtract the value from each and find the width of the box. Similarly, if we find the lowest elevation and subtract it from the highest elevation, we have our elevation height that Unity will need.
6. File > SaveTerragen Terrain > Selected Area and save it in an accessible area [/wptabcontent]

[wptabtitle] Export from Terragen to RAW[/wptabtitle] [wptabcontent]7. Now open Terragen
8. Open the .ter file you exported from 3DEM. The area you selected should now appear in the Landscape and the Rendering Control dialog.
9. Go to Export > Terrain > Export Make sure it is 8 bit Raw.


[/wptabcontent]

[wptabtitle] Import into Unity[/wptabtitle] [wptabcontent]10. Now open Unity
11. Go to Terrain > Create Terrain. A large terrain will appear in the scene view.
12. Go to Terrain > Import Height – Raw… and select the raw file we exported from Terragen
13. The Import Height dialog appears. You’ll need the data we collected from step 4 and enter it into the correct slots. The width and height of the selection box go into the X and Z. The elevation difference goes into Y. Check and make sure the Depth is 8bit, (if you used Terragen) and that the Byte order is your respective OS. Click OK.

[/wptabcontent]

[wptabtitle] The result[/wptabtitle] [wptabcontent]Unity will create the terrain from the DEM. In the scene view, the terrain may appear pixelated with jagged edges, but this is mainly due to the Scene view using LOD to render the terrain. If you drop a First Person Controller onto the terrain and hit play, the terrain will appear smooth.


[/wptabcontent]
[wptabtitle] Using GridFloat format[/wptabtitle] [wptabcontent]If the DEM is in the GridFloat format, then you can enable Unity to read into a Unity terrain. You’ll need to download the script to do this from here. Be sure the header file (HDR) for the GridFloat DEM also resides in the Asset folder.

1. Create a folder in Unity called ‘Editor’
2. Copy the HeightmapFrom GridFloat to the Editor folder.
Placing scripts into an “Editor” folder in Unity actually extends the Unity editor. Now a menu will appear underneath Terrain at the top called ‘Heightmap From GridFloat”
[/wptabcontent]
[wptabtitle]Create the terrain in the scene[/wptabtitle] [wptabcontent]

3. Select the .flt file in the asset folder. (Be sure you have the hdr file as well)
4. Go to Terrain > Heightmap From GridFloat.

The terrain should appear in the scene view.
[/wptabcontent] [/wptabs]

]]>
Converting a 3D Model to OpenCTM In Meshlab for WebGL /modeling/converting-a-3d-model-to-openctm-in-meshlab-for-webgl/ Thu, 02 Aug 2012 04:45:43 +0000 /?p=11015 Continue reading ]]> [wptabs mode=”vertical”] [wptabtitle] What is OpenCTM?[/wptabtitle] [wptabcontent]OpenCTM is a new open source file format for 3D objects that boasts impressive compression capabilities. Using OpenCTM, a 90 megabyte model compresses to 9 megabytes. This makes OpenCTM ideal for web delivery. Although there are still many kinks to iron out, the following tutorial explains how to create an OpenCTM from a 3D model and place it on the web using WebGL and JavaScript. [/wptabcontent]

[wptabtitle] Demo files[/wptabtitle] [wptabcontent]The web viewing script is here as a zip file. You will need a functional web server to place the files in. The script loads the model through an XMLHttpRequest, which requires the web page be loaded from an http server. The model won’t load if the web page is opened from the hard drive. [/wptabcontent]

[wptabtitle] OpenCTM and Meshlab[/wptabtitle] [wptabcontent]The easiest way to convert a model to OpenCTM is to use the open source 3D modelling program MeshLab. Once you have imported the mode into MeshLab, we will perform a number of steps to prepare the model for web delivery. [/wptabcontent]

[wptabtitle] Texture to Vertex Color[/wptabtitle] [wptabcontent]
1.The current JavaScript doesn’t support textures, but uses vertex color instead. To convert textures to vertex color, in MeshLab go to Filter > Texture to Vertex Color (between 2 meshes)
2.Make sure the Source Mesh and Target Mesh are the same. Then press Apply.
3.Toggle the textures off to check if the conversion was successful. Render > Render Mode > Texture. You can also find the icon in the main toolbar.
4.If the texture still appears to be shown on the model after toggling the textures off, you know that the Texture to Vertex color was successful.

texture

meshlab texture icon


[/wptabcontent]
[wptabtitle] Cleaning the Mesh[/wptabtitle] [wptabcontent]The web viewer can be temperamental about mesh geometry. If there are too many holes or rough edges, the script could cause the browser to crash or hang up indefinitely. The solution is to perform a number of steps that will clean the geometry enough for the web viewer script to be satisfied. [/wptabcontent]
[wptabtitle] Preliminary Cleaning[/wptabtitle] [wptabcontent]

1. Filters > Cleaning and Repairing > Close Merged Vertices

2. Filters > Cleaning and Repairing > Remove Duplicated Face

3. Filters > Cleaning and Repairing > Remove Duplicated Vertices

4. Remove Face from Non Manif Edges

Unclean Mesh

These steps are the preliminary cleaning methods before export. After you complete these steps, export the mesh and try to load it in the browser. If the model loads, all is well. If the browser hangs up or crashes, we’ll have to perform additional cleaning steps
[/wptabcontent]
[wptabtitle] Manual Cleaning[/wptabtitle] [wptabcontent]For manual cleaning, we need to cut any section of the mesh that appears questionable. Typically this will be near and on the edges of the mesh. The screenshot below gives a good impression of what to look for.

1. Rotate the model so that the section in question is horizontal.

[/wptabcontent]
[wptabtitle] Manual Cleaning 2[/wptabtitle] [wptabcontent]
2. Click Edit > Select Faces in a Rectangular Region
3. Drag and select the area in question

[/wptabcontent]
[wptabtitle] Manual Cleaning 3[/wptabtitle] [wptabcontent]4. Click Filter > Selection > Delete Selected Face and Vertices

5. Repeat for other questionable sections of the mesh
6. Export
[/wptabcontent]
[wptabtitle] Exporting[/wptabtitle] [wptabcontent]Whenever you want to give the model a test run, you’ll export it out as a OpenCtm file.

1. Go to File > Export Mesh as
2. In the Files of type below, select “OpenCTM compressed file (*.ctm)” from the dropdown men
If OpenCTM is not an available option for export, you may need a more recent version of Meshlab
3. Save as…

Be sure you save the model on the web server where the javascript file is located.
[/wptabcontent]
[wptabtitle] View Your Results[/wptabtitle] [wptabcontent]To see the model in the web viewer, we’ll need to open up the demo.html file and change one line of code.

1. Open the demo.html file in your favorite editor.

2. On line 72, you will find in quotes the string “changeME.ctm”

3. Change this to the name of the model. If you named the model “myCoolModel.ctm”, you want to add “myCoolModel.ctm” with quotes. If you placed the model in a folder, be sure to add the directory as well, like this “/myModels/myCoolModel.ctm.”

4. Open the website. If you placed it on a local webserver, the address will be something like “http://localhost/demo.html.” if you placed the web scripts and model on a different server, use the name of the server.

NB: Once you have exported as OpenCTM, you can also export out as OBJ for a Unity model as well.
[/wptabcontent] [/wptabs]
 

]]>
Basic Interaction and Scripting in Unity /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/basic-interaction-and-scripting-in-unity/ Sat, 23 Jun 2012 12:01:35 +0000 /?p=10291 Continue reading ]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”] [wptabtitle] Get Some Scripts[/wptabtitle] [wptabcontent]This tutorial will describe a basic setup for adding simple interactions to the walkable demo we created in the previous tutorial. To do this, you’ll use several scripts contained in the package you can download here.

Have Unity open with the project used in the last tutorial

Download it and double click on it with Unity open.

Import all the scripts.[/wptabcontent]
[wptabtitle] Script Documentation[/wptabtitle] [wptabcontent]
The scripts are documented, if you would like to view them and learn more. You can find additional resources concerning the Scripting API in Unity at the Unity Script Reference page. [/wptabcontent]

[wptabtitle] Unity Scripting Languages[/wptabtitle] [wptabcontent]Unity allows you to create in scripts in three languages: JavaScript, Boo, and C#.

JavaScript is well known for web scripting and is part of the same standard as Flash’s ActionScript. Unity’s JavaScript has notable differences, but it provides the easiest way to interface with GameObjects.

C# is native to .NET and the Mono project, which Unity is based on. It provides many advance options that JavaScript lacks.

Boo is a lesser known language. Not many people code in Boo, but it has many similarities to Python.
[/wptabcontent]

[wptabtitle] The Museum Scripts[/wptabtitle] [wptabcontent]The package contains three scripts:

ArtifactInformation.js : This is a basic data repository script. When you add it to a GameObject, you’ll be able to enter basic information about the object in the inspector that can be shown when the user clicks on the object. Place it on each artifact you wish to interact with.
We could obtain the information in a number of ways, MySQL database, XML, etc. For this demo, we are mainly worried with what to do with the data once we receive it.

ObjectRotator.js : This script allows us to rotate the object when we click on it. It also needs to be attached to each object you want to interact with.

ArtifactViewer.js : This script is attached to the FPC’s main camera. This script will detect if we are looking at an object when we left mouse click. If an object is in front, it will deactivate the FPC, show the information of the object and activate object rotate mode. It must go on the Main Camera inside the First Person Controller. [/wptabcontent]

[wptabtitle] Setup a Sphere Collider[/wptabtitle] [wptabcontent]We need to perform several steps to prepare the script for activation. I assume you have placed an artifact on one of the pedestals in the museum. Be sure to make the scale factor of .005. Otherwise, hilarity will ensue. Leave the Generate Colliders box unchecked.

Add a Sphere Collider

1. With the object selected, go to Components > Physics > Sphere Collider


This allows us to detect if we are in front of the object.

[/wptabcontent]

[wptabtitle] Add New “Artifact” Tag[/wptabtitle] [wptabcontent]1 .With the object selected, go to the top of the Inspector and click the drop down menu next to Tag and click Add Tag.

2. Open the Tag hierarchy and in Element 3, add the text “Artifact”.

3. Go back to the object’s properties in the Inspector, and make sure the newly created “Artifact” tag appears in the Tag drop down menu.

4. Do this for all artifacts you wish to interact with.

5. Select the FPC and assign the “Player” tag to it. The “Player” tag should already exist in Unity
[/wptabcontent]

[wptabtitle] Attach Scripts[/wptabtitle] [wptabcontent]1. Find the folder “Museum Scripts” in the Project panel.

2.Drag the scripts “ArtifactInformation” and “ObjectRotater” to each object you wish the user to interact with.

3.The “ArtifactViewer” script has to go in a special place on the FPC. Expand the FPC in the Hierarchy panel and locate the “Main Camera” inside of it.

4.Drag the ArtifactViewer on to the “Main Camera.” [/wptabcontent]

[wptabtitle] Add info about the artifacts[/wptabtitle] [wptabcontent]Now if you select the artifact, you’ll find where you can enter information about the artifact. You can copy and paste data from the Hampson site or come up with your own.

NB: Although the Artifact Description doesn’t show much of the text, it really does have a block of text in it.

[/wptabcontent]

[wptabtitle] Finished Museum Demo[/wptabtitle] [wptabcontent]Now if you click Play, you can click on the object and a GUI with information appears. Left clicking will also allow you rotate the model. If the rotation seems off, the pivot point may not be in the center.


You should now have a simple walkthrough demo of a museum.

This project was designed as a launching platform for more ambitious projects.
[/wptabcontent] [/wptabs]

]]>
A Walkable Unity Demo /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/a-walkable-unity-demo/ Sat, 23 Jun 2012 11:30:18 +0000 /?p=10259 Continue reading ]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”]
[wptabtitle] Intro[/wptabtitle] [wptabcontent]This chapter will show you how to put together a walkable demo of a simple museum using several models. The techniques in this tutorial can be applied in many ways. Although I use models from the Virtual Hampson museum as examples, you are welcome to use your own.

You will need to download the following model, or use one of your own:
https://dl.dropbox.com/u/22781413/museumdemo/simpleMuseum.zip

You can take a look at the final product here.

[/wptabcontent]

[wptabtitle] Create a new project[/wptabtitle] [wptabcontent]
Open Unity and go to File > New Project.

The New Project file dialog will come up.


Name the project “Museum Demo” and save it in a convenient location.

Below you will see the packages Unity comes with. A package is a set of scripts and assets that allow certain functionalities. For this demo, we will choose:

– CharacterController
– Skybox

Unity will open with an empty scene.
[/wptabcontent]

[wptabtitle] Import the model[/wptabtitle] [wptabcontent]Now we’ll import the simpleMuseum model. Either we can copy and paste the file into the asset folder using Explorer or we can drag and drop the file into the Project panel.


Click on the model in the Project panel, and its Import Settings will show up in the Inspector. You’ll want to do two things here.

1.Check the Generate Colliders box.

2. Adjust the scale factor. Every modeling application processes units differently. (For the simpleMuseum model, try a scale factor of .01 ).

[/wptabcontent]
[wptabtitle] Scene View[/wptabtitle] [wptabcontent]

Now we’ll drag and drop the model from the Project panel to the Scene view.
[/wptabcontent]
[wptabtitle] The First Person Controller[/wptabtitle] [wptabcontent]
It’s hard to see if the scale is off without another model for comparison so we’ll also drag and drop the First Person Controller into the scene.

You can find the First Person Controller* (FPC) by locating the Standard Assets folder in the Project panel and looking in the Character Controllers folder. You will see the 3rd Person Controller and the FPC .

NB: If you do not find the FPC, go to Asset > Import Package > Character Controllers and Import All.

Drag the (FPC) into the scene inside the museum model.

FPC is raised off the floor. If the FPC is partially through floor, the camera will fall to infinity. If the FPC is high above the green plane, it will fall until it collides with it.
[/wptabcontent]
[wptabtitle] FPC and model scale[/wptabtitle] [wptabcontent]The FPC is 2 units tall. Unity works best thinking the units in meters, but it mainly depends on the units used in the modeling application. If the model is larger or smaller relative to the FPC, you can adjust the Scale Factor accordingly. [/wptabcontent]

[wptabtitle] Preview the Model[/wptabtitle] [wptabcontent]Press the Play button at the top. This will compile the scripts and show you a preview. You can walk around using the arrow keys or WASD. You can look around using mouse movement. You can even jump with space bar. We’ll adjust these controls later.


If the camera falls through the model, either the FPC wasn’t raised enough off the floor or “Generate Colliders” wasn’t checked in the Import Settings. [/wptabcontent]

[wptabtitle] Scene Lighting[/wptabtitle] [wptabcontent]Likely, the preview will be dark and difficult to see clearly. Let’s add a light to the scene.


Unity provides three types of lighting typical for 3D applications: Spot, Directional, Point.

Point light is an omnidirectional point of light. Directional light imitates sun light from an angle. Spot light is a concentrated area light. To light an entire scene, we will add a directional light.

Click on GameObject > Create Other > Directional Light. [/wptabcontent]
[wptabtitle] Edit Unity Lighting[/wptabtitle] [wptabcontent]
Press E to go into rotate mode and rotate the light to obtain the desired lighting. The position of the light is irrelevant. You can change the color and intensity in the inspector while you have the Directional Light selected.

[/wptabcontent]

[wptabtitle] Invisible Colliders[/wptabtitle] [wptabcontent]Sometimes it’s convenient to be able to tightly control where users have access to. An easy solution for blocking user access is to place invisible colliders around the prohibited space.

You’ll definitely want to block access anywhere the user may fall infinity and break the user experience as in our current museum demo.

Adding invisible collider is very simple. We’ll start by adding a cube to the scene.

1.Go to GameObject > Create Other > Cube
2. Press ‘F” to focus on the cube

A cube appears in the scene view.

[/wptabcontent]
[wptabtitle] Moving the Cube 1[/wptabtitle] [wptabcontent]
We’ll move the cube to the edge of the green plane. We’ll use vertex snapping for moving objects next to other objects.

1. With the cube still selected, holding down ‘V’, a square gizmo will appear over the nearest vertex.

2. With ‘V’ still held down over the desired vertex, click LMB and the cube will snap to the nearest vertex of another object. Drag the cube so that it lines up next to the edge of the green plane.
[/wptabcontent]
[wptabtitle] Scaling the Cube[/wptabtitle] [wptabcontent]3. Now press ‘R’ to go into scale mode and scale the cube along the X axis(blue handle) along the full width of the green plane. Then scale the cube of the Y axis (green handle) so that the cube is taller than the FPC.

[/wptabcontent]

[wptabtitle] Hide the Cube[/wptabtitle] [wptabcontent]4. Finally, with the cube still selected, go to the Inspector and uncheck the box next to MeshRenderer.

This will render the cube invisible, but the collider will still be in effect.

[/wptabcontent]
[wptabtitle] Skybox Creation[/wptabtitle] [wptabcontent]
Now we can duplicate the object (Ctrl D) and reposition the duplicates adjacent to the other edges of the green plane.

Unity provides a number of skyboxes you can use. If you did not import the Skybox package when you created the project, you can import to Assets > Import Packages > Skyboxes, then click the Import button on the popup window.

Now go to Edit > Render Settings and in the inspector you’ll find Skybox Material.

Click on the little circle next to it and you’ll open the Material Browser. Unfortunately, it will show every Material existing in the project and will not cull out those only suitable for Skyboxes. But since Skybox materials usually have “sky” in the name, if you type “sky” in the search bar at the top, the browser will only show those materials suitable for Skyboxes. Unity provides various day and night time skyboxes.

[/wptabcontent]
[wptabtitle] Motion Adjustment[/wptabtitle] [wptabcontent]Most likely you will want to fine tune the motion controls and interactive experience of your walkthrough model. We’ll take a look at adjusting the speed of your movement, sensitivity of the mouse and look brief at how we can modify the scripts Unity comes with. [/wptabcontent]

[wptabtitle] Character Controller Menu[/wptabtitle] [wptabcontent]Select the FPC and you will see in the inspector how the FPC is constructed from individual components.

The Character Controller allows you to adjust the width and height of the FPC among other things.
[/wptabcontent]
[wptabtitle] The Character Motor Component[/wptabtitle] [wptabcontent]The Character Motor component allows you to adjust movement speed.

-Expand the Movement hierarchy and you’ll find the Max Forward, Sideways and Backwards Speed, as well as Gravity and Ground Acceleration.

-The most effective strategy for fine tuning is to be in Play Mode and adjust the values. Anytime you adjust a value it will be reflected in the Player. Once you have values that seem appropriate, either take a snapshot of the values or write them down. When you quit Play Mode, the values will reset to their original, and you must enter them in again.

You can also adjust the Jumping or disable it completely. It is unlikely you will need to worry about Moving Platform and Sliding.
[/wptabcontent]

[wptabtitle] Mouse Sensitivity[/wptabtitle] [wptabcontent]Looking around with the mouse may seem jarring or disorienting, but you can tweak these values so you can have a smooth experience. But we will have to look in two different locations. Unity handles X and Y rotation differently for the FPC. To adjust the mouse sensitivity in the X axis, with the FPC selected, look at the Inspector and find the Mouse Look component. MouseX should be selected in the Axes. Adjusting the Sensitivity X will adjust the mouse sensitivity in the X axes. Adjusting the Y will have no effect.

To modify the Y Sensitivy, select the FPC in the Hierarchy and expand it. You will find Graphics and Main Camera. Select main Camera and you the inspector will show another Mouse Look component. Adjusting the Sensitivity Y will modify your mouse movements up and down.

You can also decide how far the user can look up and down by adjusting the Minimum Y and Maximum Y values
[/wptabcontent]

[wptabtitle] Continue…[/wptabtitle] [wptabcontent]
These are the basics for a walkable demo in Unity. We will next look at adding a mechanism for gathering information in our walkable demo.

Extra:

A museum should have artifacts! Download several Hampson artifacts, import them and place them on the pedestals inside the museum structure. You can use them in the next tutorial. Be sure to use a scale factor of .005. Leave the Generate Colliders box unchecked.

Continue here
[/wptabcontent] [/wptabs]

]]>
Importing Objects to Unity /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/importing-objects-to-unity/ Sat, 23 Jun 2012 10:42:22 +0000 /?p=10254 Continue reading ]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”]
[wptabtitle] Basic Importing[/wptabtitle] [wptabcontent]Unity3D reads these file formats natively:

-FBX : an AutoDesk format designed for interoperability

-.dae : Collada format *

-. 3ds: 3D Studio Max

-.dxf : Drawing Interchange Format, a format used for interoperability between AutoCad and other programs

-.obj : Wavefront Object, an open and fairly common 3D model format

If you are working in a 3D modelling application and are able to export in one of these formats, Unity will be able to read it. Export the file into the Assets folder and the object will appear in your Project panel in Unity. For best results, always import as .fbx or .obj files. Unity works best with these particularly when it comes to scale.

FBX Converter
Autodesk supplies a free FBX converter on their website. You can find it here: http://usa.autodesk.com/adsk/servlet/pc/item?id=10775855&siteID=123112. [/wptabcontent]
[wptabtitle] Automatic Import[/wptabtitle] [wptabcontent]Unity is able to automatically import a number of 3D models from the following proprietary vendor format. The links will take you to Unity’s reference manual where you can find a fuller discussion of the vendor format.

● Maya
● Cinema 4D
● 3ds Max
● Cheetah3D
● Modo
● Lightwave
● Blender

If you save the scene from any of these modeling packages to the Asset folder you are working in, Unity will automatically import them in the project. You can freely go to and fro Unity and the modeling package and all edits will be reflected in Unity.
[/wptabcontent]

[wptabtitle] 2D Assets[/wptabtitle] [wptabcontent]Similarly, Unity reads Photoshop files natively so you can save your .psd files straight into the Assets folder. It’s a good idea to create a folder named Textures to keep your files organized. Using the Photoshop documents natively allow you to make edits and see the results quickly in Unity. However, you may see a lost in quality using Photoshop Documents. To avoid this, try using 24 bit PNG files. An advisable organization strategy is to save your PSD files in a folder called PhotoshopOriginals and export the png files into the Texture folder in your Asset folder. [/wptabcontent]
[wptabtitle] Continue…[/wptabtitle] [wptabcontent]Continue to read about Unity here

[/wptabcontent] [/wptabs]

]]>
The Unity Interface /modeling/software-visualization/unity-software-visualization/workflow-unity-software-visualization/the-unity-interface/ Sat, 23 Jun 2012 10:20:36 +0000 /?p=10242 Continue reading ]]> This series of posts will teach you how to navigate in Unity and to create a basic virtual museum.
Hint: You can click on any image to see a larger version.

[wptabs mode=”vertical”] [wptabtitle] The interface[/wptabtitle] [wptabcontent]
The Unity interface can be daunting on first glance. But, for getting started, we can break it down into four sections.The Unity Interface[/wptabcontent]
[wptabtitle] Scene View[/wptabtitle] [wptabcontent]

This is your 3D view, though it differs from 3D views in Blender or Cinema4D. You don’t edit 3D geometry directly in this view. Rather, you use it to place things precisely where you wish them to go. If you wish to edit your geometry, you’ll either need to open it up in a 3D modelling application or install additional components into Unity. You can also see the hierarchical structure of how your scene is composed in the Hierarchy panel below.[/wptabcontent]
[wptabtitle] Basic Movement in the Scene View[/wptabtitle] [wptabcontent]Unity uses key shortcuts similar to Autodesk Maya, but you can change them easily by going to Edit > Preferences.

Look around in your scene
1. Hold Right Mouse Button (RMB) while dragging your mouse sideways will rotate the camera in place.

Rotate around in your scene
1. Holding ALT and press Left Mouse Button (LMB).

Zoom In and Out
1. Hold ALT and RMB, and then drag your mouse in or out or sideways.Alternatively, you can use the drag wheel

Centering on an object.
1. Select an object either in the Scene view or the Hierarchy view.
2. Make sure your cursor is hovering over the Scene view.
3. Press ‘F’ to “focus” in on your object.
[/wptabcontent]

[wptabtitle] Basic Object Manipulation [/wptabtitle] [wptabcontent]
You can use the controls in the top left corner to get into any mode.

The gizmos around the selected object in the Scene will change depending on which mode you are in.

‘W’ : Will put you into Move model

‘E’ : Rotate mode

‘R’ : Scale mode

[/wptabcontent]

[wptabtitle] The Project Panel[/wptabtitle] [wptabcontent]The Project panel is your library of readily available assets you can use in your current scene. Any models or artwork you wish to place into a scene can be dragged from this panel to either the Scene view or the Hierarchy view. When you want to add assets into the Project panel, just save them to the Asset folder inside the Project folder you created at the start. If you have trouble locating where you saved your Unity project, right click on any asset in the Project panel and click on Show in Explorer.

Unity also provides a number of assets ready to go. These are located in the folder named Standard Assets. If you do not find a particular asset here, you might not have imported them when you created the project.

You can easily reimport them by going to Edit -> Import Packages -> DesiredPackage. We will look at the packages in more in depth in the next chapter.
[/wptabcontent]
[wptabtitle] The Inspector[/wptabtitle] [wptabcontent]Finally at the far right is the Inspector. This shows attributes of what you have selected. If you just have an empty game object selected, it will only show you the Transform attributes, which are its Position, Rotation and Scale. This is the base component of all GameObjects. You can position, rotate, and scale objects precisely using the coordinates in this field.

GameObjects are the heart and soul of Unity. Everything in Unity is a GameObject and you add functionality by adding Components to GameObjects much like adding layers to a Photoshop document. Common components are Character Controllers, Rigidbody, Particle Systems, and Audio Files. You can add custom functionality by creating scripts and adding them as components to various GameObjects. You can create subtle complex interaction by layering a few components to various gameobjects.
[/wptabcontent]
[wptabtitle] Continue…[/wptabtitle] [wptabcontent]Continue to learn about Modeling and Unity here[/wptabcontent][/wptabs]

]]>