Reader small image

You're reading from  Unity for Architectural Visualization

Product typeBook
Published inSep 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781783559060
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Stefan Boeykens
Stefan Boeykens
author image
Stefan Boeykens

Stefan Boeykens is a Belgian architect-engineer. Starting out as a professional architect in several offices, he returned to KU Leuven in 2000, at the Department of Architecture, for teaching and research, completing his PhD on Building Information Modelling in 2007. Stefan is an experienced researcher with a variety of IT skills. Aside from teaching BIM, he is mainly working as senior Innovation and BIM manager for the Belgian D-Studio, focusing on BIM middleware and consultancy. He is a frequent speaker at BIM-related events and is actively involved in BIM standardization groups, including CEN/TC 442 (Europe) and Belgian Technical Committees. He is father of three boys and enjoys musical composition, reading, cycling and life-long-learning.
Read more about Stefan Boeykens

Right arrow

Chapter 4. Promenade Architecturale

This chapter refines how you can set up basic navigation. While this will not explain how to create and rig characters, it will explain the use of the basic character controllers and how to set them up properly. We also discuss the use of camera objects, since it makes no sense to walk around a model without showing it.

In this chapter, we will cover:

  • First Person versus Third Person Controller

  • Loading a custom character from the Asset Store

  • Using cameras for a minimap

  • Display static text/information on screen

First Person versus Third Person Controller


In Chapter 2, Quick Walk Around Your Design, we explained how to load a default character controller, which is included with Unity. The behavior of character controllers is provided by script components. Normally, when you author a scene, you don't need to be concerned about the inner workings of the actual script. You merely assign variables and adjust parameters.

Many typical 3D action games use a first person perspective, where the camera is positioned to mimic the view through the characters own eyes. Sometimes, you also see your virtual hands or some kind of weapon, for example, Splinter Cell, Far Cry, or Half-Life. This is the recommended way to view an architectural model, as you can easily look around in all directions and it feels more immersive.

The alternative, which can be experienced in games such as Tomb Raider, Grand Theft Auto, or Assassin's Creed, is a third person perspective, usually showing the main character from slightly above...

Loading a custom third person character


When you first start using Unity, you might be glad that there is a default character available. The Construction Worker model however, is a bit too cartoon-like and probably not generic enough for serious architectural visualization.

While it is possible to model a 3D character in software such as CINEMA 4D or 3ds Max, and animate using the character tools, this subject would easily take a whole book, yet still only touch on the most essential aspects. It is out of the scope of this book, so we will fall back on using stock models.

Using a custom static model

If you don't really need animations, your first option is to replace the worker model with a mesh of your own, which can be imported from any 3D modeling software.

Setting up realistic navigational constraints makes sense when you need to evaluate a design for people with limited navigation abilities. If you need to present an elderly care center, or a hospital, or any accessible building, it can...

Adding a live minimap


Many shooting games provide a radar-view on screen. This is an overview of the map, usually with some indication of enemies or targets. In an architectural context, you can add a minimap. This is a separate camera-view, in overlay on top of the regular view. You can either have a single broad view showing the whole scene or a smaller section, following the main navigation. While not immediately obvious, you can have multiple cameras at the same time. Each camera takes a part of the screen. The default camera uses the full screen. We will now show you how to add a second camera, that floats in front of the rest of the scene:

  1. Create a new camera (GameObject | Create Other | Camera).

  2. Set its Camera component to display an Orthographic projection rather than Perspective, which makes sense for a top view. This removes any perspective view distortion.

  3. To look from above, set the Transform component Position to, for example, X = 0.0, Y = 5.0, and Z = 0.0. By setting the Rotation...

Displaying basic text/information on the screen


When giving feedback to the user, you can display text or images on screen. They are often placed as an overlay on top of the rest of the scene.

  1. The simplest, but static approach is using a GUITexture or GUIText (GameObject | Create Other | GUI Text or GUI Texture), as shown in the following screenshot:

  2. The Transform component works a bit differently from regular 3D positioning. They are expressed in Screen space, with X going horizontal from 0 (left) to 1 (right), and Y vertical from 0 (below) to 1 (top). Place the text at 5 pixels from the upper left corner, by setting the Transform position to X = 0, Y = 1 and the Pixel Offset in the GUI Text component at X = 5 and Y = -5.

  3. To place a fixed image (for example, a Logo), follow the same approach: Transform position and Pixel Inset. The image should be loaded first as a 2D Texture (simply dragging any image into Unity suffices).

Beware that they are not the most efficient, performance-wise and you...

Summary


This chapter took control over navigation into the next level. We showed how to set up the Third Person Controller and how you can use either the default worker character or one of the Asset Store packages, which might come at a price. All setups, either FPC or 3PC also control the Camera component, which is essential to display anything on screen. Without a camera, you wouldn't see anything happening. But you don't have to stop at a single camera either. You can layer several cameras in the same scene, using the Depth field and the Normalized View Port Rect section. You can overlay even more information or simply add static text and logos, which are easily set up using a GUI Text and GUI Texture. They do not require any scripting. More advanced user interfaces will be discussed in Chapter 7, Full Control with Scripting, when introducing GUI scripting.

The next chapter will further fill our project with models and set up an environment. This will make our project more interesting...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unity for Architectural Visualization
Published in: Sep 2013Publisher: PacktISBN-13: 9781783559060
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime

Author (1)

author image
Stefan Boeykens

Stefan Boeykens is a Belgian architect-engineer. Starting out as a professional architect in several offices, he returned to KU Leuven in 2000, at the Department of Architecture, for teaching and research, completing his PhD on Building Information Modelling in 2007. Stefan is an experienced researcher with a variety of IT skills. Aside from teaching BIM, he is mainly working as senior Innovation and BIM manager for the Belgian D-Studio, focusing on BIM middleware and consultancy. He is a frequent speaker at BIM-related events and is actively involved in BIM standardization groups, including CEN/TC 442 (Europe) and Belgian Technical Committees. He is father of three boys and enjoys musical composition, reading, cycling and life-long-learning.
Read more about Stefan Boeykens