An object in 3D space

Similar documents
Chapter 2 Motion. Now consider a horizontal pipe running through it (left to right). Now, a vertical pipe (top to bottom) runs through the same point.

Chapter 12 Notes: Optics

Animatron Tutorial. Ronald Bourret

3.6: First Person Computer Games

Working with the BCC Z Space II Filter

Chapter 5. Transforming Shapes

The Alice Scene Editor

Grade 7/8 Math Circles November 3/4, M.C. Escher and Tessellations

Name: Date: Concave Mirrors. 1. Reflect the rays off of the concave mirror. Principal axis

Answers. Chapter 2. 1) Give the coordinates of the following points:

Sphero Lightning Lab Cheat Sheet

When you move an (unparented and unrotated) item in Layout, generally your mouse movements have the following effects:

1. What is the law of reflection?

THE FOURTH DIMENSION (AND MORE!)

Chapter 15: Penguin - Point Editing and Blending

Unit 1, Lesson 1: Tiling the Plane

Walk Cycle with Symbols

Working with the Dope Sheet Editor to speed up animation and reverse time.

Using Flash Animation Basics

Beaumont Middle School Design Project April May 2014 Carl Lee and Craig Schroeder

Tutorial 4: Texture Mapping Techniques

4. Refraction. glass, air, Perspex and water.

BoA Tools Page 1 / 31

Working with the BCC Z Space I Filter

(Refer Slide Time: 00:02:02)

Modeling a Gear Standard Tools, Surface Tools Solid Tool View, Trackball, Show-Hide Snaps Window 1-1

Topic. Section 4.1 (3, 4)

Installing and Using Trackside Cameras Revised November 2008

Physics Optics Problems. Science and Mathematics Education Research Group

This document describes the user interface, navigation and the common resources that are available in SvalSim

WJEC MATHEMATICS INTERMEDIATE GRAPHS STRAIGHT LINE GRAPHS (PLOTTING)

Web-Friendly Sites. Planning & Design 1

Tangents. In this tutorial we are going to take a look at how tangents can affect an animation.

ILLUSTRATOR TUTORIAL-1 workshop handout

Stop-Motion TOPICS. The Stop-Motion Camera Stop-Motion Options Add Mode Stop-Motion Camera Orientation Onion Skin

Part II: Creating Visio Drawings

BCC Sphere Transition

Science 8 Chapter 5 Section 1

Adding Depth to Games

Pong in Unity a basic Intro

Rational Numbers and the Coordinate Plane

Telling a Story Visually. Copyright 2012, Oracle. All rights reserved.

SketchUp Starting Up The first thing you must do is select a template.

Advances in MicroStation 3D

Physics for Scientists & Engineers 2

Geometric Transformations

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

1.! Questions about reflected intensity. [Use the formulas on p. 8 of Light.] , no matter

lundi 7 janvier 2002 Blender: tutorial: Building a Castle Page: 1

What s New to Version 2.0

Autodesk Navisworks Freedom Quick Reference Guide

Answer Key: Three-Dimensional Cross Sections

A bouncing ball squashes on its vertical axis and stretches on the horizontal axis as it strikes the ground.

The Wireframe Update Buttons. The Frontface and Backface Buttons. The Project Designer 265

Name Class Date. Using Graphs to Relate Two Quantities

Lesson 11. Polygonal Spaceship

Three-Dimensional Figures

Design and Development of Unmanned Tilt T-Tri Rotor Aerial Vehicle

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

Two-Dimensional Waves

Taking the Best Reference Photos

Computer Science 474 Spring 2010 Viewing Transformation

Practice Exam Sample Solutions

Adobe Flash CS4 Part 4: Interactivity

This overview summarizes topics described in detail later in this chapter.

Just change the sign of the -coordinate. Let s look at the triangle from our previous example and reflect

The playhead, shown as a vertical red beam, passes each frame when a movie plays back, much like movie fi lm passing in front of a projector bulb.

Interesting Application. Linear Algebra

AutoCAD 2009 Tutorial

CSIS 0801 Final Year Project. Implementation of An Intelligent Hexapod Robot. Individual Final Report - Kinematics

A simple problem that has a solution that is far deeper than expected!

Homework Set 3 Due Thursday, 07/14

AREA Judo Math Inc.

Chapter 15. Light Waves

Create Models or Use a Library? Create your own library How to Get Started? [ 140 ]

Light and the Properties of Reflection & Refraction

Optics INTRODUCTION DISCUSSION OF PRINCIPLES. Reflection by a Plane Mirror

Chapter 0. Getting Started. Objectives

Autodesk Moldflow Insight AMI User Interface

Mathematics Background

LESSON 2 MODELING BASICS

26 Geometric Optics, Reflection

Alice. Coverage. Mathematical Expressions, Conditional Statements, Control Structures. Arithmetic Expressions Built-in Functions Conditional Execution

Polygons in the Coordinate Plane

Objective: Construct a coordinate system on a plane.

1. Mesh Coloring a.) Assign unique color to each polygon based on the polygon id.

5 Subdivision Surfaces

CS 465 Program 4: Modeller

B ABC is mapped into A'B'C'

Section 1.5 Transformation of Functions

Quick Crash Scene Tutorial

Camera Shots. Lesson Plan

Chapter Adding 1- T Mo he tio B n le to nde Yo r ur Inte Scerfac ne e Landscape Scene Stormy Night.mp4 End 200 Default Animation frame 1 Location

Index of Refraction and Total Internal Reflection

Velocity: A Bat s Eye View of Velocity

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

Viewing with Computers (OpenGL)

Animatron Tutorial. Ronald Bourret

Section 3.1 Graphing Using the Rectangular Coordinate System

Introduction. There are two basic ways to apply more than one texture to one object:

Transcription:

An object in 3D space An object's viewpoint Every Alice object has a viewpoint. The viewpoint of an object is determined by: The position of the object in 3D space. The orientation of the object relative to a 3D coordinate system. For example, causing the Coach object in Figure 6 to move to a different position or to face in a different direction, or both would change his viewpoint. An object's center point Every Alice object has a center point and three axes. The center point is the position in space (relative to the object) at which that object's three coordinate axes cross. (This is often called the origin.) For example, the center point of the Coach object shown in Figure 6 is a point on the ground midway between his feet, and approximately below the top of his shoelaces. An object's motion If you move an Alice object, you are actually moving its center point. The rest of the object comes along for the ride. (See sidebar.) If you turn an Alice object to the right or to the left, you are rotating the object around one of its three axes. (We will see later that this causes the object to rotate around its green axis.) If you turn an Alice object forward or backward, you are rotating the object around a different axis. (We will see later that this causes the object to rotate around its red axis.) If you roll an Alice object to the right or the left, you are rotating the object around a third axis. (We will see later that this causes the object to rotate around its blue axis.) Think in terms of rotating axes instead of rotating objects A disconnected object Note, however, that it is possible to break the connection between an object and its component parts. For example, you could cause the Coach object to move away and leave his arms behind. When you rotate an object around one of its axes, that axis remains stationary and the other two axes do the rotation. The remainder of the object comes along for the ride. Often when rotating objects, it is easier to visualize rotating two of the axes around a third axis than it is to visualize rotating the object itself. We will see an example of this later when we roll the Coach object's left arm to the right in order to cause him to lift his arm.

Italicized method names Why did I represent the words move, turn, and roll in boldface Italics in the above text? I did that to emphasize that I wasn't simply using a generic term for producing motion. Rather I was using a very specific term that has an official connotation. The official connotation is that move, turn, and roll are the names of methods that are used to produce very specific kinds of motion. (You will learn a great deal about methods in subsequent lessons.) Drawing a 3D cube By the time most children reach middle school, they already know how to draw a 3D cube on a sheet of 2D paper. This is true even if they have never had a drawing class. (Does this mean that humans have some inherent knowledge of 3D coordinate systems?) The pictures that they draw are likely to look a lot like Figure 1, or possibly like the yellow outline in Figure 2 without the red, green, and blue lines. Figure 1. A 3D cube. Figure 2. Outline of a 3D cube (note the yellow lines).

A 3D coordinate system While those middle-school children probably don't realize it, they are already drawing in a 3D coordinate system. A 3D coordinate system is typically thought of as consisting of three axes where the angle between any pair of axes is ninety degrees. (In mathematical terminology, the axes are orthogonal.) Thus, the three axes are related to one another in the same way that any set of three edges that meet at a corner on the cube in Figure 1 are related to one another. The X, Y, and Z axes Scientists and engineers typically think of the three axes as the horizontal axis (often called X), the vertical axis (often called Y), and a third axis that is perpendicular to the plane formed by X and Y (often called Z). Don't worry, however, because Alice doesn't deal with X, Y, and Z axes. Rather, Alice deals with one axis that runs from left to right, a second axis that runs from bottom to top, and a third axis that runs from front to back.

A man with one eye Going back to Figure 1, imagine that a man with one eye is inside the cube. His eye is located at the exact center of the cube and he is facing the inside surface of the medium blue panel. In other words, he is looking directly at the exact center of the medium blue panel with his one good eye. This causes the dark panel to be at his right. It also causes the light blue panel to form a ceiling above his head. A 3D coordinate system in this case would have its origin inside his eyeball. One axis would be sticking out directly in front of his eye (we will refer to this axis as the blue axis). A second axis would be sticking out to his right (we will refer to this axis as the red axis). A third axis would be sticking straight up from his eyeball (we will refer to this axis as the green axis). A picture of the 3D coordinate system described above Now look at Figure 2 and you will see the 3D coordinate system described above. The blue axis in Figure 2 is the axis that would be sticking out directly from the front of the man's eyeball. In fact, if you take a closer look at Figure 1, you can see that blue axis protruding slightly from the center of the medium blue panel. Similarly, the red axis in Figure 2 is the axis that would be sticking out of the man's eyeball toward his right. Once again, a close examination of Figure 1 shows a small portion of that red axis protruding from the dark panel to the man's right. Finally, the green axis in Figure 2 is the axis that is sticking directly up from the man's eyeball. A small portion of that green axis can be seen protruding from the top panel of the cube in Figure 1. Memorize these colors Memorize these colors. In Alice, when you see a blue axis, it is protruding from the front of an object. When you see a red axis, it is protruding from the right side of an object and when you see a green axis, it is protruding from the top of an object. It is important to remember that the directions front/back, right/left, and up/down are relative to the viewpoint of the object, and not relative to the viewpoint of you the viewer. For example, once the object is drawn (rendered) in the world, the right/left, front/back, and up/down directions relative to the viewpoint of that object don't change. If I were to rotate the cube in Figure 1 so as to turn it "upside down", the green axis would then point downward, but that would still be the top of the cube relative to the cube's viewpoint.

A penguin diving into the water As another example, I recently created an animation where a penguin walks over to a hole in the ice to dive in. When he arrives at the hole, the green axis is pointing out of the top of his head. He jumps up and rotates in the air (turns forward around his red axis) so that his feet are up and his head is down. At that point, the green arrow is still pointing out of the top of his head but now it points at the water below the penguin. I had to write code to move him "up" to make him fall "down" into the water. The object's center point As mentioned earlier, every object in the gallery has a center point and it may not be where you expect it to be. The center point is the origin where the three axes join with respect to that object's viewpoint. The case for the cube shown in Figure 1 and Figure 2 is straightforward. The center point of the cube is at the exact center of the cube. The center point for a penguin, on the other hand, is at a point in space on the ground midway between the penguin's feet. Many gallery objects have component parts To complicate matters even further, a penguin object is made up of five smaller component objects: head right leg left leg right wing left wing Each of those component objects may contain other component objects. For example, the head contains the following component objects: upper beak lower beak Every component object has its own center point Because the right and left wings of a penguin object are themselves objects, it is possible for us to animate a penguin causing it to flap its wings independently of one another. We can do that by rotating each wing around one of its axes. However, in order for us to figure out how to do that, we must know where the center point is for each wing and we must know what constitutes front, right, and up from the viewpoint of the wing. In other words, we must know the directions of the red, green, and blue axes relative to the center point of the wing.

Turn and/or rotate As I explained earlier, if we tell a penguin or any other object, (such as a penguin's wing) to turn to the right or to the left, that object will rotate around the green axis that goes through the object's center point. If we tell an object to turn forward or backward, the object will rotate around the red axis that goes through that object's center point. Finally, if we tell an object to roll to the right or to the left, the object will rotate around the blue axis that goes through that object's center point. As you can see, in order to cause a penguin to flap a wing, we must know the position of the wing object's center point, and we must also know the directions of the red, green, and blue axes that go through the center point for that wing. An airplane example Now consider another example. Take a look at the airplane shown in Figure 3. Figure 3. An airplane with its 3D axes exposed. Suppose we wanted to animate the airplane to make it appear that it is flying in 3D space. Note that the green axis protrudes out of top of the airplane, the red axis protrudes out of the end of the right wing, and the blue axis protrudes out of the front of the airplane. These directions are respectively, up, right, and forward from the viewpoint of the pilot in the cockpit. Airplane motion is complex If we wanted to cause the animation to be realistic, we would need to combine at least two of the three possible rotations for each different type of

Make a right turn If we wanted to cause the airplane to make a right turn at the same altitude, we would tell the airplane to turn right. That would cause the airplane to rotate around the green axis. In airplane jargon, this is known as yaw. airplane motion. For example, when an airplane turns to the right or to the left, it doesn't remain level from side to side. In more common terminology, the airplane banks, which is a combination of yaw and roll. Dive toward the ground If we wanted the airplane to dive toward the ground, we would need to tell the airplane to turn forward. This would cause it to rotate around the red axis. In airplane jargon, this is known as pitch. Roll If we wanted the airplane to turn over and fly upside down, we would tell it to roll right or to roll left. That would cause it to rotate around its blue axis. In airplane jargon, this is known as roll. Roll, pitch, and yaw Thus, an object in 3D space can yaw, pitch, or roll, and can do any one of the three in either of two directions. Therefore, the object can experience any combination of the following three rotations: 1. yaw left or yaw right (it cannot yaw left and yaw right at the same time) 2. pitch down or pitch up (it cannot pitch down and pitch up at the same time) 3. roll left or roll right (it cannot roll left and roll right at the same time) Translation In addition to rotation about the three axes, an object can also move (translate): 1. forward or backward (but not both at the same time) 2. right or left (but not both at the same time) 3. up or down (but not both at the same time) Six degrees of freedom More on airplane motion In addition, an airplane always needs to be moving forward in order for the wing surfaces to create lift and cause the airplane to stay in the air. The combination of the three possible rotational motions and the three possible translational motions results in what is often called six degrees of freedom. Thus, Alice objects can be animated with six degrees of freedom (or more if you count the fact that the legs, arms, wings, etc., can experience independent rotation and/or translation while the object to which they belong is also experiencing rotation and/or translation).

A little more discussion about the cube Now let's go back and discuss the cube a little more. The surface on which the cube is setting in Figure 1 and Figure 2 is also an object. Thus, it has a center point where its 3D axes join. The center point and the corresponding forward, right, and up axes are shown in Figure 4. (Remember, green is up, red is right, and blue is forward.) Figure 4. Center point of a surface. Can be rotated and translated Just like any other object, the surface can be rotated around any of the three axes, and can be translated in three different directions. There is one major difference, however. If you roll the airplane in Figure 3, it will look like an upside-down airplane. It was created using artwork that was designed to be viewed from any direction in 3D space. The Alice surface shown in Figure 4, on the other hand, was not created with that in mind. Therefore, if you roll the surface, until you turn it upside down, the result won't be very pleasing. A partially transparent version of the cube The cube that you see in Figure 5 is the same cube that you saw in Figure 1. Figure 5. A partially transparent version of the cube.

However, in Figure 1, I caused the 3D axes belonging to the cube to be displayed. In Figure 5, I caused the 3D axes belonging to the surface on which the cube is setting to be displayed. In addition, the cube in Figure 1 is 100% opaque while the cube in Figure 5 is only 50% opaque. This makes it possible to see the 3D axes belonging to the surface showing through the cube. In other words, the cube in Figure 5 is 50-percent transparent. (Opacity and transparency are the reverse of one another.) An object's axes travel with the object Every object has a center point and has its own set of 3D axes. The center point and the 3D axes belonging to an object travel with and rotate with the object, independently of the other objects in the world. Thus, the 3D axes belonging to the penguin that I mentioned earlier traveled and rotated with him. When I caused him to turn forward one-half revolution in order to dive headfirst into the water, this caused his green axis, which originally pointed up (from my viewpoint) to be pointing down (from my viewpoint). As a result, I had to move him up to force him to fall down into the water head first. Animating component objects belonging to an object There is one other topic that I want to explain before we leave this lesson. I told you earlier that many Alice objects are composed of other objects and that every Alice object has six degrees of freedom. Even the smaller component objects that make up other objects have six degrees of freedom. However, it may not make sense to exercise all six in all cases. (In real life, an airplane cannot fly backwards, but a helicopter can fly backwards.)

Consider a Coach object Consider, for example, the Coach object shown in Figure 6. Figure 6. A Coach object. The Coach object is actually made up of a large number of component objects, each of which has six degrees of freedom.

Consider the left arm at the shoulder Let's consider just his left arm at the shoulder joint as shown in Figure 7. Figure 7. Left arm of the Coach object. The coach looks like a headless ghost You may be wondering how I produced the image shown in Figure 7. To begin with, I repositioned the camera so that it would provide a better view of the center point on the left arm, which is what I wanted to see in detail. Then I made his head invisible just to get it out of the way. Then I set the opacity property of the upper body to 30-percent so that we can still see it for reference, but we can also see through it in order to see the shoulder joint. Finally, I caused the left arm to be rendered as a wireframe drawing instead of a solid drawing. This made it possible for us to see the center point of the left arm along with the 3D axes associated with that center point. Note the directions of the axes To begin our analysis, we recognize that the green axis is pointed up at this point. Similarly, the blue axis is pointing toward the front (from the coaches viewpoint), and the red axis is pointing into the coach's upper body toward his right side.

Should we move his arm? Three of the motion possibilities having to do with six degrees of freedom involve movement or translation along those axes. We can quickly recognize, however, that if we move the arm along any of those axes without causing the coach's upper body to move at the same time, we will simply rip the coach's left arm off of his body. For example, Figure 8 shows the result of moving the arm a short distance to the left along the red axis. Figure 8. Left arm moved to the left. Therefore, unless we are animating a torture chamber, the three translation possibilities available for the arm aren't very useful.

Rotate around the green axis Another motion possibility is to rotate the arm around the green axis. If we turn the arm onefourth of a revolution (90 degrees) to the right, the coach will be pointing to the front. That would be OK, as shown in Figure 9. Figure 9. Arm turned 90 degrees to the right. However, if we turn the arm to the left instead of the right, we can't turn it very far until we would put it in a position that is not possible for most humans. So, we would need to be careful as to the limits if we turn the arm to the right or to the left.

Rotate around the red axis We could turn the arm backwards so as to rotate it around the red axis by as much as one-half revolution (180 degrees) as shown in Figure 10. However, turning the arm backwards by more than this, or turning the arm forward by any amount at all would put the arm in an unnatural position. Figure 10. Arm turned backwards by 180 degrees.

Rotate the arm around the blue axis That leaves us with two more possibilities. We can roll the arm to the left or to the right, thus causing it to rotate around the blue axis. For example, Figure 11 shows the arm rolled to the right by one-eighth of a revolution (45 degrees). Figure 11. Arm rolled right by 45 degrees. As you can see, this caused the coach to lift his arm so as to point skyward. Difference between a right roll and a left roll The difference between a right roll and a left roll can be a little confusing. To avoid the confusion, don't think primarily in terms of what happens to the arm proper. Rather, think of what happens to the red axis. For example, a right roll around the blue axis will cause the red axis to tilt downward, just like a right roll in an airplane will cause the right wing to tilt downward. In the case of the coach's left arm, if the red axis tilts downward, then the arm proper, which protrudes in the opposite direction from the red axis will tilt upward. The grand finale It is important to note that when one of these turn or roll operations is performed, the arm's 3D axes travel or rotate with the arm. For example, the green axis no longer points straight up in Figure 11. As a result, we could follow the motion in Figure 11 by a turn to the right by 45 degrees (rotation around the new position of the green axis) and follow that by a turn backwards by 180 degrees (rotation around the new position of the red axis) resulting in the image shown in Figure 12.

Figure 12. Arm point to the left and up with palm up. Note that I made all of the coach's body parts visible in Figure 12 so that we can see the new position of the left arm in the context of the entire body. In this case, the coach is pointing slightly upward and slightly to his left with his palm turned up. Summary In this lesson, I explained some of the concepts surrounding an object in 3D space in general, as well as some of the Alice-specific concepts surrounding an object in 3D space. For example, I explained the concept of an Alice center point and the color coding used by Alice for each of the three axes that intersect at the center point in an Alice object. I explained the concept of yaw, pitch, and roll and related them to the methods named turn and roll in Alice programming. I explained that many of the objects in the Alice gallery are constructed from smaller component objects, and that every component object that is used to construct a larger object has its own center point and its own 3D coordinate system. I explained the meaning of the commonly used term "six degrees of freedom" and explained that every Alice object has six degrees of freedom. I also explained however, that it may not be realistic to exercise all six in a particular animation. I walked you through the fairly difficult procedure of applying motion to one of the arms belonging to a computer replica of a human while avoiding putting the arm in unnatural positions.