Book Image

Unity for Architectural Visualization

By : Stefan Boeykens
Book Image

Unity for Architectural Visualization

By: Stefan Boeykens

Overview of this book

Architects have always relied on drawings, renderings, and sometimes even movies to present their design concepts to clients, contractors, and other stakeholders. The accessibility of current game engines provides new and exciting possibilities to turn any design into an interactive model that anyone can experience at their own pace. "Unity for Architectural Visualization" explains how you can create compelling, real-time models from your 3D architectural project. Filled with practical tips and in-depth information, this book explains every step in the process, starting from the very basics up to custom scripts that will get you up to the next level. This book begins with a general overview of the Unity workflow for architectural models. You will start with a simple project that lets you walk around in your design using basic Unity tools and methods. You will then learn how to easily get convincing lightning effects on your scene. You will then set up a basic navigation system in your project, and not only this; you will also cover some tips and tricks to take navigation to the next level. You will quickly learn how to fine-tune the shaders and how to set up materials that are a bit more advanced. Even when you finish Unity for Architectural Visualization, this book will make scripting easier with reusable examples of scripts that can be applied in most projects. After reading this book, you will be comfortable enough to tackle new projects and develop your own.
Table of Contents (15 chapters)
Unity for Architectural Visualization
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Further interactions


We finish this chapter with some more useful techniques.

Resetting the player

What if, at one point, the user reaches the edge of the terrain or world you created and falls off? Instead of expecting the user to quit and restart, you should solve the problem elegantly. We place a large, invisible plane underneath our world, as a trigger to reset the player.

  1. Add a Plane GameObject and set its Mesh Collider to Is Trigger. Make it large enough to extend to all sides of the scene and move it down underneath all other objects, as in the setup in the next screenshot.

  2. Disable its Mesh Renderer, to make it invisible.

  3. Create a new C# script called resetPlayer and add the following code. It takes three private variables: one for the player's position (pos), one for its rotation (rot), and then the actual reference to the player (thePlayer). This is shown in the following code:

    using UnityEngine;
    using System.Collections;
    public class resetPlayer : MonoBehaviour {
      private Vector3 pos...