0% found this document useful (0 votes)
46 views98 pages

VR Note Part 3 - Compressed

Uploaded by

VIMAL KUMAR D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
46 views98 pages

VR Note Part 3 - Compressed

Uploaded by

VIMAL KUMAR D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 98
6.5 VR systems 203 6.4.4 Non-immersive VR systems It cannot be denied that 3D immersion transcends all other modes of human- computer interaction. Actually to be there with the model or data, and to view it from any point of view, simulates the powerful sensory feedback we experi- ence from living in the real world. Immersion integrates the user with a virtual model by providing object constancy. That is to say, in the physical world we learn through experience that when we move around another object such as a chair, it remains stationary no matter how we move. At a quantum level this is not so. The very act of observing something can disturb its behav- iour! Nevertheless, being able to rely upon features of stability enables us to develop a consistent internal world model that supports various cogni- tive processes. Recreating object constancy, together with all of the other visual cues found in illumination, texture, shadows and so on reinforces our acceptance of the VE as a believable experience. The traditional graphics workstation, on the other hand, can be used to paint a picture of some 3D environment. Indeed, many workstations can render these images in real time, which allows the user to navigate through the environment using a joystick or Spaceball. In some respects the workstation is operating like an interactive television, where an animated scene provides us with a 2D window on some environment. At all times, the user is aware of looking at a picture rather than looking at an object. Now this non-immersive approach to 3D interaction is just as valid as any other form of interaction, and will probably always exist, and may even remain the dominant mode of graphical interaction for some time. 6.4.5 Multi-participant systems Modern computer systems have always been able to support multi-users, and recent advances in video technology, especially in the area of real-time image compression, have made real-time collaborative working a reality. The ability to support multiple participants ina logical and scalable way is a key issue for future VR systems. It requires the creation of a highly distributed model of computation that scales well to multi participants and guarantees adequate performance to individual users, while resolving any potential database conflicts. In principle, though, it is possible to network a group of people such that they can interact with one another in a virtual domain, and be aware of one another in their interaction. 6.5 VR systems iption given in thi be interpreted as description given in this chapter ; we ton can be configured. It has been used as a simple arious system elements can be configured to allow On no account the only way a VR syste! model to show how the v: 204 A Generic VR System ual database. As VR technology evolves, totaly new system approaches will appeat. ‘These might include multimedia inter pee yepunication networks and ByPrid configurations. For the moment, though, such developments are research projects, but they will eventual “ transform what we currently accept a5 VR. 7 ‘a user to interact with a virt 7 Animating the Virtual Environment 7.0 Introduction Associating a sense of mass:or speed with a collection of hand-drawn lines is an essential skill in the world of traditional animation, and animators develop such skills through meticulous observation. They are interested in the complex movement of animals, humans and incidental things such as falling leaves, a dripping tap or curtains blowing in the breeze. When their visual memory fails them they resort to simulation and experimentation until they distil the essential dynamics that characterize a behaviour. Within their own virtual worlds they can emphasize any behaviour to add an enhanced sense of fun, surprise or drama, which is why cartoons are so enjoyable. Computer animation, on the other hand, provides the animator with an alternative approach to the animation process. For example, the computer can be used to assist in the line drawing process and output frames hich can then be back-painted and integrated with other hand-drawn to cel, wl 1 ott elements. Another approach allows the image to be held within a frame store, d output to video tape. Perhaps the rendered automatically by software ant ‘ : P most exciting contribution computers offer the animator is the ability to create and animate 3D virtual objects. ; Although 3D computer animation presents a. powerful technological alter- native to the traditional tools of pencil and paper, so far it cannot offer a com- plete substitute for animation. Perhaps one of the main problem areas for computer animation revolves around the human-computer interface. In car- toon animation the animator simply draws lines on. paper, and when sufficient frames have been produced they are animated asa line test. Although the pro- cess is tedious, it is completely interactive and the animator is,always in control. 205 206 — Animating the Virtual Environment i i ‘ks at a compute; tion, an animator worl : = avait a tool does not exist for acertain effect, “ode, which is often part of an animator’s 7 Wesents similar problems, for the yy the supporting software, However, with 3D computer ani screen using a range of software too! then someone must write some extra co daily work. Animating objects in a VE P icipated b: user can perform only those tasks anticipa’ ‘the su Pf The level of support needed to animate objects in VE varies from application to application. In some cases the user sal cise entmee motion of objects through interaction, while in others the eUw" Obes Mist behave autonomously to the user. For instance, a virtual © fal its hands in unison with the current time. When simulating @ gear tain, Bears are expected to rotate in the correct direction and at the right Te maient simulator application, windscreen wipers, electric windows and instruments must behave naturally, as must the virtual traffic. Ina flight simulator, virtual aircraft land and take off automatically, and airport ground traffic moves the organs convincingly along roadways. In a more esoteric application, a modelled inside a virtual human body are expected to behave and move like their real-world counterparts. * * Behavioural control is already playing an important role in virtual environments. For example, when developing new handling procedures for robots, it is convenient to simulate this at a virtual level. This implies that the robot must be endowed with behaviours typical of its real-world counterpart. Operators can then be trained to handle the robot with safe and practical manoeuvres, without damaging a real robot or endangering themselves. British Telecom are experimenting with behaviours associated with large multi-tier communication networks that may fail through random faults or sensitivity to network loads. A VR system is then used to explore how software reacts to these faults by redirecting messages around failed nodes. As a last example, Colt International have developed VR software to simulate how groups of humans behave under emergency conditions. For example, in one scenario, up to 200 virtual humans are assigned one of a set of rules associated with vacating a building. As the simulation progresses, queues occur, exits are blocked and a potential disaster is seen forming. By redesigning access to-exits, a building can be mad i of a real disaster, ‘ade safer without the lesson ‘ we wil xolore Several schemes that will enable us to simulate a variety of physics viours using simple mathematical models. Unfortunately, the real-time domain poses a consider: h af 7.1 The dynamics of numbers into another. The numerical envelope of the change is important, so too are the derivatives at any point in the operation. For example, if a ball has to be animated bouncing on a floor, the ball’s centre could be used to guide its motion. To prevent the ball from passing through the floor we have to ensure that its centre point is never less than the ball’s radius from the floor. Further- more, if the ball’s motion is to appear realistic, we have to simulate its downward acceleration in a gravitational field, and its deceleration after it bounces and moves upwards. To prevent the ball from bouncing indefinitely, some loss has to be introduced to attenuate the ball’s energy. Such animation is a trivial exercise, but computing more complex behaviour requires non- trivial levels of computing power, and should not be underestimated. Physically-based motion can be emulated by evaluating the relevant equations, but very often realistic motion can be simulated by numerical inter- polation. For example, to simulate a door opening or closing we need to compute an angle of rotation at various instances in time. The dynamics of this angular value should reflect the object's inertia when its velocity changes, and incorporate the losses introduced by air resistance and friction. To compute the instantaneous angular rotation from first principles could be an unnecessary complication, especially if we can develop a simple interpolation procedure that produces a similar result. To understand how such schemes work, the ideas of linear and non- linear interpolation will be developed and applied to various animation scenarios. 7.1.1. Linear interpolation We can linearly interpolate between two values v, and v, using the following equation: v(t) = (b—2)y, + for O : 3 1.16) ot . - v(e) = 18 +277 44+ en Evaluating (7.17) over the range 0<1<1 : we obtain the in Table 7.4. The graph of the equation is shown in Figure 7 valve shown i 7.2. The animation of objects In the real world objects the form of linear and angular a ntS® Potential energy and kinetic ener i as a centre of gravity and a momen am: We also associate attributes, i" object’s behaviour under vag o! inertia, Which enable us to predict & motion provide a us lynamic conditi o 3 of scenarios can be simulated ewer to compute these predicted such be examined Inter in this epee S¥E- This form of physical simulation Wi! to the simple linear animation of objec Moment, We will restrict ours’ ects, 7.2. The animation of objects 215 Table 7.4 For every value of t, v(t) represents a Hermite interpolation between 0 and 10, wit ond en ith start and end derivatives of 1. t v(t) pe 0.0 on a 0.352 02 1.136 0.3 2284 04 3.568 0.5 50 0.6 6.432 0.7 7.156 0.8 8.864 0.9 9.648 1.0 10.0 WO 10 9 8 7 6 5 4 0 0.1 02 0.3 04 05 06 0.7 08 09° 10 t 0 and 10 with both i mite interpolation between values peal ay i Nol that the f-axls is scaled by a factor of 10, which is why jerivat = the starting and finishing slopes do not appear correct 7.2.1 Linear translation *s update rate is F Hz, then the time slice ¢ between each update Te te oyster ef F = 25 Hz, each frame is separated in time by 40 ms. is I/F, For example, "virtual object moving at a speed S, it must be If we now wish to ‘ince St between each update. In the ease of something displace Hiner diteoce walking pace, for example 100cm s-! with & aa Hi alana _apPremobject must be displaced 3,66em for every update, I I Environment 216 — Animating the Virtual Figure 7.6 The displacement of an object can be computed by the product of its component velocity and the time t = (tnow — tprev)- Unfortunately, we cannot rely upon a consistent update rate frequency, which means that the system’s real-time clock must be interrogated to determine the actual time that has elapsed since the last update. Therefore, the time slice ¢ must be derived by subtracting the previous time torev from the actual time frow+ Figure 7.6 shows an object located at the VE’s origin and assigned a speed S, across the XZ-plane. To simulate this sliding movement the x- and z-coordinates of the object must be modified by the corresponding com- ponents of the vector (troy — fyrey)Vo- The velocity V, can be defined as the scalar S, representing the linear speed, and a unit vector for the direction. If jhe ane tae RO eg foto the XZ-plane at an angle of 45°, its unit is [0.707,0.0,0.707]". i zovordinates are thee reread pe erenea made to the x- and To contain the object within specific compute the object’s new velocity a! i Fi o has been reversed, and the other two compe” rsal of the x-component' is only because © 7.2 The animation of objects 217 Zw Boundary Figure 7.7 The point object is moving with a linear speed of S, in a direction given by the unit vector V,. Where it hits the boundary at P, it bounces off at an angle equal to the angle of incidence 8. boundary was orthogonal to the x-axis. The computation of elastic coliisions for any arbitrary planar boundary is covered in Section 8.4.2. If an object’s kinetic energy is required to decay with time, a parameter can be used to reduce the linear speed either by a constant amount or by a fraction of its current speed at each frame update. In the first case, the new speed S; is given by: 55 =S.— As (7.18) where S, is the previous speed and As is the constant reduction. S; must be prevented from going negative. In the second case, the new speed is given by: Sg = kS, (7.19) where k is some suitable decay constant, Table 7.5 shows the two approaches with an initial speed of 36, As =3 and k = 0.8. 7.2.2 Non-linear translation i i i lation techniques - quadratic, cubic 7.1.3 we examined three interpol ‘ ' a Berle which can now be used to control the non-linear motion of objects. As an illustration, we will develop the controlling matrices to move an object using a cubic interpolation. } 7 " “te. itor exemple it is required to move an object along the x-axis in 1 secor 2 ause momentarily, and then return it to its original position in nai. ts have to be non-linear and controllable, and can 2 th movement ° , t be eae ey computing the x-translation as a function of time. 218 jronment . Virtual Enviro! Animating the linear decay in ‘The left-hand column shows the tne te Oe Table nt ty ecg he en ar deny cased ¢ ws ; Fhe right-hand olan sronstant proportion. 36.0 28.8 33.0 23.0 30.0 18.4 27.0 14.7 24.0 11.8 21.0 9.4 18.0 16 15.0 6.0 12.0 48 9.0 . 3.9 6.0 Ba 3.0 - —_—_—— If the real-time clock is in units of seconds, then at time 7; the transla tion can begin. At time 7;, that is (7; + 1), the object pauses momentarily and then begins its return journey, and at time 73, that is (T, + 3), it comes to rest at its original position. A parameter f, such that 0 <¢ < 1, is used to control the two interpolations and is defined as follows: t=T-T, while T, < T< Ty (1.20) t=(T-T-1)/2 while, nse obtain the results shown in Table 7.6, and the graph in llowi ’ Figure 7.8. Me ithe Gehl 1210 = 0.0, = 1% (7.25) 220. Animating the Virtual Environment x! 3 Time T Figure 7.8 The relationship between the x-coordinate x’ and time T. During the period 10 < T < 11 the translation increases, and during the period 11 < T < 13 the translation decreases. The individual values are found in Table 7.6. Note that the values of c,, cy, ¢, and cy have been carefully chosen to ensure that there is a smooth acceleration and deceleration at the start and end of each movement. As can be seen from Table 7.6, the x-coordinate x’ alters from 1.000 at T = 10, reaches 3.000 at T = 11, and returns to 1.000 at T = 13. The graph in Figure 7.8 confirms that the interpolation is non-linear, and that the two movements are asymmetric. 7.2.3. Linear angular rotation In Chapter 3 we saw that the VO’s gaze orientation can be specified using objects, although some are more useful than others. In this section we will consider XYZ Euler angles and quaternions. XYZ Euler angles XYZ fixed angles achieve a com i r pound rot: rotations about the OCS's fixed three axes, whereas the rotation about an axial system that a duel its Tocal pane oe n animating an object such that it rotates once F » ‘ice about its x-axi The rot Su ‘axis every second. © rotation about the y-axis is a yaw rotation, while the rotation abou! applying three individual whereas XYZ Euler angles achieve tates with the object. To illustrate 7.2 The animation of objects 221 the x-axis is a pitch rotation, and they are specified by the following matrices: cosyaw 0 sin yaw 1 0 0 o 1 0 . © cospitch —sin pitch 0.6) —sin yaw 0 cos yaw 0 sin pitch cos pitch where yaw and pitch are the yaw and pitch angles respectively. ite wales Hoe Yaw and pitch could easily be computed if the angular ioe were for each frame update, However, there is no guarantee aa peeie update aio an be maintained in a real-time VR system. Conse- atly, we will use the real-time clock t i i es ‘0 ensure that the original rotational If the current time is given b: i i rs yy T, and T, is the event when the rotation was initiated, then yaw and pitch can be defined as: yaw = 360°(T — T,) aan pitch = 720°(T — T;) (1.28) These assume that the system clock value is in seconds. The complete matrix operation is given by: x! x y’ | = baw] [pitch] | y (1.29) a? z where [yaw] and [pitch] are their respective matrices and must be updated at each system update. Even though the angular rotations are themselves constant about their axes, the distance covered by any point varies during the rotation (Vince, 1992). Quaternions Section 3.2:4 describes how a single quaternion can represent the product of three individual quaternions dyav» Gpict aNd dou: Encoded within this single quaternion are the axis of rotation and the angle of rotation as follows: Gypr = (008 6/2, sin 6/2] 7.30) where @ is the angle of rotation and u is a unit vector representing the rss was also shown earlier with (3.75) how apr can be represented by a single matrix: My Miz Mis 1.31) My; Mz, Mas My; Maz Mas where: i ent 222 — Animating the Virtual Environm' My = 1-207 +27) Miz = 209 - 2) My = 202 +97) My = 2(x9 +52) 2 My = 1 —2(x? +27) Myy = 2(yz - 8x) My, = 2(x2 - sy) cos roll/2 + sin.yaw/2 sin pitch! 2 sin roll/2 s yaw/2 sin pitch/2 cos roll/2 + sin. gan cos lil 7a a in yaw/2.cos pitch/2.cos roll/2. — 0s yaw 2sin i ‘ sin io z= cos yaw/2.c0s pitch/2 sin roll/2 — sin yaw/2 sin pitch/2 cos roll/2 If we repeat the above example where the roll rotation is zero, the values of 5, x, y and z become: s = cos yaw/2 cos pitch/: * (7.33) s = cos yaw/2 00s pitch/2 x = cos yaw/2 sin pitch/2 139 » = sin yaw/2 cos pitch/2 = —sin yaw/2 sin pitch/2 Evaluating s, x, y and z for interpolated values of yaw and pitch, we discover that the speed of any point varies slightly with time, just like XYZ Euler angles. This can be overcome, but before addressing this problem let us examine the effect of interpolating quaternions. The quaternion equivalent to zero rotation is the identity quaternion % = [1,0,0,0]], and if we interpolate between Q@ and q,,,, we obtain a quaternion that changes its rotation from zero to @. To begin with, let us saniore the possibility of linearly interpolating the individual components 2 ‘ollows: 9=(1-1)a0+ yy for 0 z dist oo 99 0.0 1.0 1,000 ou pH ee 1.0 0.989 0.145 a oo Her 1.0 0.956 0.153 o3 ae eat 1.0 0.897 0.159 0s 0.0 0.707 ip ott oes os 90 om? 1.0 0.707 0.165 as 20 wale 1.0 0.581 0.165 on oo . 1.0 0.441 ont63 oa oo 0.956 1.0 0.294 ols 08 i 0.989 1.0 o.14s oe . 1.0 10 0.000 Seta Figure 7.9 V;, V2 and V are unit vectors. V is an interpolated vector such that V=aV, + bV>. The text derives values for a and b based upon (1 — #)@ and £6, a unit sphere is a surface satisfied by the relationship st route between two points is a great d in ship navigation. In four dimensions, the unit hypersphere is a data set satisfied by the relationship ca + a + 224s? = 1, and the shortest route is a 4D arc. We can develop a single inter- polant for all three structures by investigating the 2D case. ‘Consider two unit vectors V, and V2, as shown in Figure 7.9, separated by an angle 0, The interpolated unit vector V can be defined as: In three dimensions, x?4y? 42? =1, where the shorte circle, a so-called orthodrome, as use 224 Animating the Virtual Environment (7.36) VeaV, + V2 ' Je between the two vecto; fic angle rs, is controlled by 2 speci the angle between V the ce between Vy and ¥ is defined 25 2, an Be raison the angle bayews Vv, gue 7,9 we can see the fol : V, is (1 — ¢)@. From Fi f a b 37 sin(I—1)6 sinté acost@ 7.38) n= bcos(1 — 1)6 mt+n=l Therefore: asin (0 (739) in (1 — 2) and: asin 10 cos (1 — 1)6 _ 1 7.40) acs +— ne — Ae Solving for a we obtain: owl ge ge (1.41) "sing sin@ The final interpolant becomes: - in 10 yas ey, , 2 sy aa sin sin Interpolating between two unit vectors V, and V, separated by 60° we obtain the data shown in Table 7.8. The first column shows the status of the interpolant f, and the second and third columns list the x- and y-components of the interpolated unit vector V. The fourth column shows the linear distance dist travelled between each interpolation, and its constant value confirms that the angular rotation is uniform, Interpolating between two arbitrary unit vectors the angle @ would be derived from the 2D dot product: eat 0s 0 = Vy + V, asl The very nature of this inner Product infers that @ has a range 0° < 6 < 180° oan prev ae a sin term in the denominator, whic used only for two li ir . range of the interpolation is limited ° linearly independent vectors. Thus the The same interpolant can bi 1 1 used this with another example. Consider the i and V,= [0.707,0.0,0.707} * shown in Fi re 90° and we want to interpolate linearly Detween 3D vectors, and we will confirm unit vectors V, = [0.0,1.0,0.0]" 7.10, Their angular separation i$ them to derive a vector V, wher: Zz Figure 7.10 V;, Vp and V are unit vectors, where V is interpolated between VY and Vp using the interpolant described in the text. sin (1-1)0 sint@ sin U-O0y 4 Sy, ind Vitine ? (1.44) If V is evaluated for @ = 90°, and 0<#<1, we obtain the data shown in Table 7.9. Again, the dist column confirms that equal distances are travelled for equal changes in the interpolant /- : ; Now we can return to the problem of interpolating between a pair of quaternions. Giverttwo quaternions 4o and yp, an. interpolated quaternion q is derived as follows: 225 a 26 — Animating the Virtual Enviro’ 2 of e vector derived from interpola Ho we interpolating Parameter 7 nin ext © column confirms that the linea _ ye and s-components Table 7.9) TE umn shows the Table 7 ors. The fst col” A tne last = ferret iat the point’s coordinates! MY 9 157 at t igy 1.000 0.000 2 ae Bin 0.988 O11 oa 0.219 0.951 0.219 Aa 0321 0.891 0.321 He 416 0.809 0.416 a3 ti 0.707 0.500 05 0.500 0.588 0.572 0.6 0.572 0.454 0.630 0.7 0.630 08 0.672 0.309 0.672 09 0.698 0.156 0.698 0.000 0.707 1.0 0.707 . 5 — .e.q.0;080 0 >a Table 7.10 The effect of using an interpolated quaternion to rotate the point (0,1,1) The first column shows the status of the interpolant f; the through a yaw rotation of 90°. columns headed s, x, y and 2 give the interpolated quaternion; and dist represents the ines distance travelled at each step. ——— C y # dit t s x 0.0 0.0 0.000 1.0 1.000 % O01 0.0 0.156 1.0 0.988 0.2 0.0 0.309 1.0 0.951 0.3 0.0 0.454 1.0 0.891 0.4 0.0 0.588 1.0 0.809 0.5 0.0 0.707 1.0 0.707 0.6 0.0 0.809 1.0 0.588 oe 0.0 0.891 1.0 0.454 ts 0.0 0.951 1.0 0.309 ia ae 0.988 1.0 0.156 ). q= 20-26 sinto sing 1+ 5 Wor i) that the interpol; lant functi constant at 0.157, inctions correctly as the distance moved at each st’? ® a , Angular rotations ar ngular rotation Slows down fr © Not always J, 4 , fom tt} YS line; ee y and he moment it is set dese spinning top loses ener “i » and a pendulum swint 7.2. The animation of objects 227 Zz x Figure 7.11 The door is to be rotated about the y-axis through an angle of 90° its pivot and comes to rest unless it receives some external source of energy. To imitate such behaviour we need to control precisely the angle rotated at each frame update, and we will consider the use of XYZ fixed angles and quaternions in this role. XYZ fixed angles The XYZ fixed angles are often referred to as roll, pitch and yaw, and they perform individual rotations about the fixed z-, x- and y-axes respec- tively. They can be used in any sequence, however a popular sequence is roll, followed by pitch, followed by yaw. In matrix form this is represented by: xt * y’ | =Lvaw] [pitch] [rott] | » (7.46) z = where (x,y,z) is the point to be rotated, and (x’,y‘,z’) is the rotated point. Let us take a simple example involving a yaw rotation, where we have to rotate a door through 90°, but with a faired movement. Figure 7.11 shows the geometry. As this is a simple yaw rotation we can represent the operation by: x ‘cos yaw 0 sin yaw |] x] yl-[0 1 0 dl» ou) z —sin yaw 0 cos yaw || z where yaw = f(t). 228 — Animating the Virtual Environment .e value of the function hermite for both Earle son ever the range 0 <¢< 1 hermite t 0.000 Ol 0.028 o2 0.104 03 0.216 oa 0.352 : os 0,500 06 0.648 07 0.784 0.8 0.896 09 0.972 1.0 1.000 If f(t) is a function linearly dependent upon the system clock, the door will appear to open with constant angular velocity. However, we can introduce @ non-linear interpolant to fair the movement. For example, let us define a function hermite that returns a value between 0 and 1. The input parameters to hermite are the derivatives at the start and end values, together with the interpolating parameter t. The function is defined as: 2-2 1 1][o WS hermite(R, Rat) = [1 2? ¢ 1] 3.3.52 1]} ot 1.4) ’ 0 o-1 olfR, 1.0 0 offR, where R, and R, are the derivatives at ¢ = 0 and ¢ = 1, respectively. For instance, if both R, faiod a and R, are set to zero, the function definition becomes: -2 hermite(0,0,t) = [1 2 rj 3 as 0 . : 0 hermite(0,0,t) = 27 43,2 | ¥e as If this i shown in Table 7 ye Ost S 1, hermite(0,0,t) takes on the va is symmetric and inchudes s@2P" i Figure, 7.12'shows that the fut function of hermite as follows mp tle fairing. If we now define ya" ee » Our door will oj i -linear rotatl® JAW = 0 hermite 0,0.) pen with a non-line ford, th ale sci falling. If fyoy'= 0, the particle has just hit the reverted pee tn pe weet fs astie collision will bounce upwards with its velocity floor as shown in Figure pony it~ 0+ the particle has passed through the igure 8.2(c). When this Occurs we can take various actions: 81 Objects falling in a gravitational field 243 Ground a ‘Gaa Vow © .(b) The particle has, is ling, therefore Apow 20. (b) Figure 8.2 (@) The particle : a 1 The particle has elfecively intersected the the ground, therefore hnow = Stound plane, therefore hnow < Physical Simulation (1) If the sample rate was high and the velocities low, we could ignore the point of collision and reposition the particle on the ground plane with its velocity reversed. (2) We could assume that the conditions were such that a collision has occurred and the particle has bounced and starts its upward journey at Arey With a reversed velocity Of Uprey- (3) We could compute the precise time of the collision by solving a quadratic equation, compute the particle’s velocity on impact and derive its new position and velocity as it bounces upwards during the remaining time interval! The choice we take depends upon the level of realism we want to simulate, If we do wish to compute the precise moment of impact and reposition the particle accurately, then the following equations can be used. The time f, it takes for the particle to strike the ground after the previous time sample fy. is given by: [ol beh. prev + {Uprev + 28hiprev 8.7) & There are two roots to this equation and we must take the positive one. The particle’s velocity v, when it strikes the ground is given by: eRe + 28ltey 8.3) This time we take the negative root. Therefore, at a time (tprey + tg) the particle strikes the ground at a speed of v,. ‘The next stage in the computation is to reverse the sign of the velocity as it starts its upward journey. The particle still has (taow — fprev — t,) seconds to travel with this starting velocity, and by substituting these time and velocity values in (8.9) and (8.10) we can determine its final velocity and height Upc and Ayo, as follows: s Y, Ynow = Ug — Bt 8.9) ¢ (8.10) In the above calculations the particle has a radius of zero. This can easily be introduced into the collision detection by effectively shifting the particle’s frame of reference vertically by the radius +, The time f, to collide with the grourid now becomes: . Urey + LVprev + 28 (hyrey — 7) ; 11) zg at 8. Irow = Ugt — $gt?. where t toow = trey = 8.1.1 Temporal aliasing The above example raises a fundamental problem associated with all discret? sampling systems, namely, aliasing. Figure 8.3 shows diagrammatically wha! 8.1 Objects falling in a gravitational field Figure 8.3 Temporal aliasing arises when any continuous system is discretely sampled. In this situation, the simulation code computes parameters and different points in time. The display code may sample this data on a regular basis, which introduces irregular temporal sampling. lation code is evaluating a numerical model at a varies in time. At any time f,, values of the display code is updating the display processor with the latest version of the simulated model at a different rate. yen though this update rate is regular, the sampling process results in an inconsistent display of the simulation producing temporal aliasing. A practical way of minimizing this phenomenon js to increase the sample rate of the simulation code. is occurring. The simul: particular sample rate that probably v, and h, are computed. Meanwhile, 8.1.2 Restitution continue indefinitely, however, ‘ bouncing particle should , Theorie eitaion calculation is handled determine oe ies ia introduced into the model. Practically, the particle shoul con - oe because of imperfections in the physical system, and the co at . energy into heat and sound. This can be effected acer ceil speed. v, as restitution e which relates the separation speed v, to the aPP ~ follows: vs = 0, where 0S eS 1 / : rio WE could attenuate the bouncing cycle by (8.12) In the bouncing particle seen 245 246 Physical Simulation Figure 8.4 When a particle strikes a rigid surface, the separation speed and angle are influenced by the coefficient of restitution, introducing a value of e = 0.95, say, when the particle’s velocity is reversed. By keeping e = 1, a perfectly elastic collision occurs, while a perfectly inelastic collision is created when e = 0. Figure 8.4 shows a particle striking a smooth rigid surface with an approach speed v, at an angle a, and a separation speed of v, at an angle of 8. The component of its velocity tangential to the surface remains constant, whereas the magnitude of the normal component is influenced by the coeffi- cient of restitution as follows: v,sin8 = v,sina (tangential component) (8.13) 2,c0s 8 = ev,cosa (normal component) (8.14) Therefore: etan@ = tana (8.15) and: : v3 (sin? 6 + cos? B)'='v2(sin?a + €? cosa) (8.16) Therefore: _ 4 = %qsin? a +e cos? a 8.17) and: B= tan™'((tana)/e) (8.18) 8.2 Rota In Chapter 7 we saw how rotational movements are achieved using matrix techniques, so let us now examine some of the practical issues of simulating rotating elements in a VE, g wheels 82 Rotating wheels 247 Figure 8.5 If wheel A is rotatin . poste. directo a bind opposite direction at a rate proporional ie /ny. heel 8 wil rotate inthe 8.2.1 Gear trains Consider the problem of animating the rotational speed of a wheel in contact with some driving wheel. Figure 8.5 illustrates two wheels A and B, with radii 7, and ry, and rotational rates w, and w, rad s~! respectively. At the point of contact P, the angular speed of wheel A is w,7,, which must be the same for wheel B, that is if we assume zero slip between the two wheels. However, as wheel A is rotating anticlockwise, wheel B is driven in the opposite direction, therefore the following relationship holds: ply = — Wala as and: oy = Et [rad s"] 6.20) To If ¢ seconds is the elapsed time from some ate ion whet Ace ola i iJ] rotate —@aff_/T radians w! o,f radians and wheel B will rote ms substituted into the relevant matrix used to rotate wheel nd rotational motion ig a simple relationship linking surface, there is 2 simp! If a wheel or ball rolls across a ee 8.6 shows 8 ‘wheel of ras rvhose the linear and rotational speees, © prance d travelled ater inear centre is travelling at 4 speed v. The lin is given by: 8.2.2 Combined linear 4 (8.21) d=ut is: The angle 6 turned by the wheel is 248 Physical Simulation Figure 8.6 If wheel of radius r is rolling! with a linear speed of v, the distance travelled in time t is ut, which must equal the arc length rolled by the wheel. The angle @ turned by the wheel equals ut/r {radians}. 6 = d/r[radians] (8.22) therefore: 6 = vt/r[radians] 1 (8.23) Now consider a wheel of radius r modelled as shown in Figure 8.7(a) with its centre coincident with the origin of its OCS. It can be animated to roll along the x-axis of the VE by applying suitable rotation and translation matrices. If at time 4 the wheel has an instantaneous linear speed of v, then at time 4,, it will have rotated @ = u(t; — t)/r radians and moved a linear distance d= u(t, — 4). Therefore, the translation matrix is: 100d cin Hag olor oo10 ; 0001 % (8.24) 8.2 Rotating wheels 249 PO,-1,0) ‘ / @) 20 P*20.0) (b). Zw Figure 8.7 (a) A wheel of radius r is modelled such that its centre is at the origin of the OCS. (b) During one revolution the point P(0,—1,0) is transformed to P’(2x,0,0). (Note that the r term lifts the wheel in the y-direction by its radius) and the rotation matrix is: cos(—9) —sin(-@) 00 sin(—6) cos(-#) 00 (eas) 0 o 10 0 0 01 ‘es 250 Physical Simulation - (Note that the angle of rotation @ is negative, because the wheel rotates clockwise relative to the OCS), which simplifies to: cos@ sind 00 ~sin@ cos 00 (8.26) o 0 10 0 0 OL and the two matrices concatenate to: cos@ sind Od -sin@ cosé 0 r 8.27) 0 0 10 0 0 o1 For instance, say v = 2ar, (f; — fo) = 1 and r = 1. The distance travelled is d=2n, and the rotated angle is 360°. Substituting these values in (8.27) produces: : 10 0 2x o101 (9.28) 0010 0001 which confirms that a point P(0,—1,0) is transformed to P’(27,0,0) after 1 second, as shown in Figure 8.7(b). 8.2.3 A steerable wheel Let us now consider simulating a steerable wheel that can roll about the ground plane under the control of some external agent. This will probably be the VO who is controlling the wheel’s speed and direction through some interface. The system samples the wheel’s linear speed v, and steering angle @, at some frequency, which hold until the next sample is made. The wheel is modelled as shown in Figure 8.8(a) with its centre at the origin of the OCS, and rotates about the Zp-axis. Three matrices are needed to position the wheel in the VE: the first matrix rotates the wheel about the Zo-axis of the OCS by the accumulated roll angle « (Figure 8.8b); the second matrix rotates the wheel about the Yo-axis by the current steering angle 0 (Figure 8.8c); and the third matrix translates the wheel (x,r,z) in the VE. At time ¢, the wheel is located in the VE as shown in Figure 8.9, with the following conditions: r is the wheel’s radius @ is the accumulated angle rolled by the wheel 8.2 Rotating wheels 251 Yo Xo } Zo Yo Los) ¥ © Zo © Zo is modelled with its centre at the origin of the Figure 8.8.) As wheel radix to simulate roling. (c) Its then rotted 8 S. (b) It is rotated a ing angle. about the Yo axis to simulate the steering ang! 252 Physical Simulation Gene) 2y Figure 8.9 This plan elevation of the VE shows two views of the wheel at P and P’. Initially the wheel has a steering angle of 6, a linear speed v and an incremental steering angle of . These parameters are used to roll it to its next position at P’ 4 is the steering angle turned by the wheel P(x,r,z) is the current position of the wheel’s centre @ is the incremental steering angle (6 + 0) v is the linear speed of the wheel Both ¢ and v are always available to the real-time system, and note that ¢ is assumed to be non-zero. If at time f the wheel is at position P (Figure 8.9) with a linear speed v and an incremental steering angle $, then at time t,, the wheel will be at P’, having rolled a linear distance u(t, — %). The wheel will therefore roll through an angle u(t, ~ f)/r radians, The geometry in Figure 8,9 shows that the wheel is steered about a point (47.2) with a turning radius R. Therefore, the following conditions exist: , Rb = (4 ~ 4) (8.29) RB = 0(t,~ tla (8.30) ag "> Relat 8.31) % =Reosd pend Me =x+ay 2x4 Rsind 33) % =Zt+%y=2+Reosd 5 a6 we now have sufficient information to develop the three ‘matrices that will © applied to every wheel vertex in the following order: 8.2 Rotating wheels 253 a ne _ | = [eanslate] [steer] [rot] ey HA k Roll matrix The roll matrix rotates the wheel about the Zp-axis of the OCS, by an angle a. This angle, however, increases by the sheverore ¥y the rolled angle between each update, v(t — ) # 6.36) atat The roll matrix cosa —sina 00 sina < cosa 00 0 0 10 8.37) 0 0 01 Steer matrix The steer matrix rotates the wheel about the Yo-axis of OCS by an angle 0. However, this angle increases by the incremental steering angle between each update: orate (8.38) Therefore, the steer matrix becomes: cos@ 0, sind 0 - O..1..0 0 wi | —sin® 0 cos@ 0 ( OO OL Translate matrix ‘ it ‘The translate matrix translates the wheel into the VE by the new position of the wheel, which is obtained by rotating the previous position (x,7,z) about (x.,0,z,) by the incremental steering angle @ In matrix terms, this is expressed as: translate translate | roiaie o about Y-axis) | (_ g _, | ‘ale (re tok (=%e0)-z) : ee HD a If cose 0, sind 0] 1 0 Ooms 04. Oe [foe Oirinbierd © 04]: 0c1 Om oe 0.0-1 x |f-—sing 0 cose 0)} 00 1s Coes ooo 1fLoood 254 Lf Physical Simulation’ Zw Figure 8.10 This plan elevation of the VE shows two views of the wheel at P and P’. The wheel has a steering angle of 0, a linear spéed v and an incremental steering angle of zero. Its new position at P’ depends only upon v, ¢ and 8. The above geometric reasoning holds only for non-zero values of ¢. If the controlling agent sets this input value to zero,'it implies that the wheel should continue forward in the current direction defined by 6. For this to occur, the wheel is still subjected to the roll and steer matrices, but the translation matrix is modified. Figure 8.10 shows the relevant geometry. If at time ty the wheel is at P(x,r,z), travelling at a speed v with a steering angle @, then at time 7, the wheel will be at P’(x’,r,z’), having rolled a linear distance u(t; — to). Therefore: x’ =x~0(4 —%) cos8 (8.42) z'=2+ v(t, —%) sind (8.43) These values are then substituted into the translate matrix (8.41) as before. There are some interesting features of this example worth exploring. To 8.2. Rotating wheels 255 Yo Ye Yo (a) hrs X oO min Xo oe Xo (b) Xo Zo Figure 8.11 (a) The hour, minute and second hands. (b) The three angles free, Onin and Op,; are used to rotate the individual hands about the Zp -axis. 8.2.4 Clocks roblem of animating a clock to show the current time. Basically, atrices to rotate the clock’s hour, minute and second delled as shown in Figure 8,11. For this example s available in the form of (hrs, min, sec), 2.) As the second hand is initially is given by: Consider the pi we need to develop the m: hands. These hands are mos we will assume that the current time i which will be used to derive (8:5 sO min » pointing at the ‘15 second’ position, A. 2, = 90 — 6 sec (8.44) pointing at the “15 minute’ position, 6%, is given by: (8.45) As the minute hand is 2j,'= 90 — 6 min — sec/10 Similarly, 62, is given by: 256 Physical Simulation 6g,4= 90 — 30 Ars — min/2 — sec/120 (8.46) If these angles are substituted into the matrix for _ Shia ike eae ‘lock will always to the clock hands for each frame, the cl i. time. ‘We should also remember to translate each hand focward slightly along the z-axis so that the hands do not intersect one another. 8.3 Elastic collisions Most collisions between real objects are complex physical interactions, For instance, the objects may have irregular boundaries; the individual surfaces may have different coefficients of friction; their densities may be non- homogeneous; the objects may possess angular momentum; and the objects might be travelling across an irregular surface which itself introduces non- linear frictional forces. Simulating such phenomena is possible but beyond the scope of this chapter. 8.3.1 Direct impact of two particles Principle of the conservation of momentum The simplest collisions to simulate involve two imaginary particles with mass and velocity but no size. When two such particles collide, their new velocities are controlled by the principle of the conservation of momentum and the Principle of relative motion. The momentum of a particle is the product of its mass and velocity, and, given two particles with mass m, and m,, and associated velocities v, and vy, then: ‘Mq¥_ + mys = constant (8.47) The principle of relative motion The principle of relative motion states that the relative velocity after an impact equals the relative velocity before the impact multiplied by the coefficient of restitution. Therefore, if the Tespective velocities of the two Particles after the collision are u, and uy, then: Uy ~ uy = ~e(v, ~ v4) (8.48) where ¢ is the coefficient of restitution, When two bodies collide, the interaction is assumed to take place during a short time interval. The forces generated during the collision are assumed to be much larger than any external forces such as gravity and wind resistance. Furthermore, any two-particles are assumed to move in the same straight line connecting their centres. Such collisions are called ‘direct impact’ To illustrate the principle of the conservation of momentum and relative velocity, consider the case of particle 4 with mass ™, and velocity v, striking particle B with mass m ‘i ‘ : » and velocity y,, een ea tions. Their total momentum is given by: 2” Mavelling in opposite direc 8.3 Elastic collisions 257 Momentum = mgv, + mv, | 8.49) If the following conditions prevail: m=5 =2 my, ty = <4 and the velocities of A and B after the impact are u, and uy, then: Mga + MyVy = Mgug + mau, (86.50) and, using the relative velocities for a perfect elastic collision: Ha — Uy = — (Ug ~ vp) 5) Therefore: (5x 2) + (3% -4) = su, + Buy (8.52) =2)= Sug + 3uy 8.53) and, using (8.51) we have: Ma — Uy = —(2 — (-4)) = -6 @.54) From (8.53) and (8.54) we discover that u, = —2.5, and uy = 3.5. 8.3.2° Oblique impact of two particles Figure 8.12 shows two particles A and B positioned at c, and ¢, at the time of impact. Their respective approach velocities are v, and v, at angles a and 8 relative to the line connecting their two centres. °°" The components of velocity perpendicular to the line c,cy are unaltered by the collision, and are given by v,sina and v, sin 6 respectively. The com- ponents of velocity parallel to the line ¢,c, are subject to the conservation of momentum because the particles’ masses are accelerated. Therefore: Sool Mg + MyVp = Mala COS a + Myity COS B (8.55) By Newton’s law of relative motion, : i - e = —e(v, cos a — v,c0s 8) 8.56) where eis the coefficient of restitution. Substituting (8.56) in (8.55) we have: t (8.57) i tad m, + mp = rnp — er) opcos 8+ mev,cosa(l + 8) i ea) 7: m, +My ie and its direction of motion is found from The final velocity of each particl ts. the icular and parallel components. : a eis B is at rest, the final velocities are given by: 258 Physical Simulation v,singr vpsing Figure 8.12 When two particles A and B collide with velocities v, and vp, at angles a and f to the line joining their two centres, the components of velocity perpendicular to the line, are unaltered, The tangential components are determined by applying the principle of the conservation of momentum. (my = emy)ugcosa a m, + my aan | Mgt, C08 a(1 +e) Sb weg) ce ‘i Fics ape i : 8.60) Furthermore, its velocity after impact must be directed parallel to the line €a¢» as its perpendicular velocity component was zero. hi If the new direction of the colliding particle A is defined in terms of an ‘angle 8 relative to the line c,c,, then: tan = SN hat bi ee AN Ug ‘ ce SE A Sabie 2 a (m, + my) tana i ‘ a eat Mg — em, If the two particles have the same mass, then: (8.62) 8.4 Projectiles 259 OpypZ,) Zw Aw Figure 8.13 The source of the 7 Projectiles is (xp,y,,z,), and t are used to position the exit vector. Suse) spd i gnats 6 a0 8.4 Projectiles Shells and bullets are the first things we associate with projectiles, but any object projected into the air is a projectile, be it a coin, stone or table. An inflated balloon, however, cannot be considered as a projectile as its buoyancy and air resistance are significant factors influencing its motion. For the following. analysis it will be assumed that the frictional force due to air resistance is insignificant, and that the earth’s gravitational force is constant at all heights. 8.4.1 The motion of a projectile i i f a projectile, let us In order to develop a general solution to the trajectory of a ctile, employ the scenario shown in Figure 8.13, where an object is projected from the position (Xp,¥p»Zp) With velocity Yo and orientation angles @ and a. The initial velocity components are given by: ” 5) “Dy = Uy cos 000s a we v, = vy sin @ — v, = v, cos 6 sin a After time ¢ after projection, the yelocity components are given by: My (8.66) by = v4 608 8 c0s a 260 — Physiéal Simulation vy = vy sind — ge 6.67), v9 cos Osin (8.68) e position of the projectile (x,y,z) after time f is given by: X= Xp + VptC08 C08 a 8.69) Y=Yp + votsind — + gt? 8.70) Z= 2p + votcosdsina 8.71) Using (8.69), (8.70) and (8.71) we can translate an object to position (x,y,z) as the elapsed time progresses. The resulting path is parabolic constrained within a vertical-plane. The influence of a cross-wind can be introduced by defining the wind’s speed and direction as a vector and adding the components to (8:66), (8.67) and (8.68). 8.4.2 Collision with the ground Earliet in Section 8.1 we investigated the problem of detecting when a falling object struck the ground. It was shown that different strategies could be adopted depending upon the level of accuracy required. The same applies in this situation. If we maintain the status of the Projectile at each sample, we can identify the precise moment in time when the Projectile’s height becomes zero. At this point we can determine the impact velocity. Rather than repeat this analysis again, we will continue and consider the behaviour of the Projectile if it. bounces off the surface. As the ground plane is a specific case, an arbitrarily oriented surface will be used to derive the bounce vector. Figure 8.14 shows a surface whose orientation is specified by its normal vector N. The incident unit vector is vi and the bounce unit vector is V,, If, restitution is ignored, the angle of incidence @ equals the angle of bounce. From Figure 8.14 it can be seen that the surface normal vector N, is, given by: N= -Vi+ Vy (8.72) =Vi Vp = cos 20 = 20579 — 1 a 6.73) Nel Sasa pirate . /;|cos : (8.74) but as V; is a unit vector: . INu| = 2cos@ (8.75) Using the dot Product definition: —Vi+N =cos6 * (8.76) Therefore; ” i INul = 2(-¥;-N) an 8.5 Simple pendulums Figure 8.14 The relationship between the inci e incident ‘unit y, normal vector Nand the unit bounce vector V, ‘unit vector V,, the unit surface but: ‘Nu, -WitVo INal = 2(=¥i- 8) she 2(-V,-N)N = -Vi+ Vo (8.79) Therefore, the bounce vector is given by: My = Mit 2(-¥ieN)N (8.80) It is left to the reader to implement this geometry and introduce the effect of restitution. 8.5. Simple pendulums It can be shown that a simple pendulum exhibits approximate simple harmonic motion if it consists of a heavy concentrated mass suspended by an inexten- sible cord and restricted to a swing of up to +14°. To simulate this behaviour dynamically we must analyse the forces shown in Figure 8.15. In this figure we-see that the mass of the pendulum, m, is supported by a cord of length L. If the mass is displaced from its upright position by an angle @ radians, a restoring force m sin 6 will attempt to re-establish equilibrium. The accelera- tion @ produced by this restoring force is given by; 261 262 Physical Simutar Figure 8.15 When a pendulum is displaced by an angle 0 from the vertical Position, a restoring force m sin 6 attempts to re-establish equilibrium. The future position of the pendulum is determined by computing its velocity and acceleration from this force. msing : a= Y vie 8.81) a=gsind zt (8.82) If the angle of swing does not exceed +14°, sin 9 is approximateh jal to 9 radians. Therefore, we can write: me vem ‘ a=¢9 ee 8.83) But for these small angles: : at : (8.84) gag a (8.85) 8:6 Springs 263 At any point in time ¢, the pendulum has di acceleration a. Therefore, at time ¢ + Ay the ser daentent d, velocity v and ee is given by: The acceleration is given by: a anid L 887) and the new velocity v’ by: Lot =o ade (8.88) If the equations for the displacement, velocity and acceleration are iterated, the ede ie ert ened. The pendulum is animated by rotating ed igh and angle @ relative to the upright position, 8.6 Springs The motion of an object attached to a spring or a piece of elastic can be simulated by analysing the dynamic forces acting upon the object. Figure 8.16 shows a spring of length / hanging from a rigid fixing. If an object of mass m is attached to the free end of the spring, it will bounce up and down with simple harmonic motion. Two laws are used to describe the active forces, namely Newton’s second law of motion, and Hooke’s law. Hooke’s law states that the tension T in a spring is given by: ea, e wi Ay (8.89) Vedra. i 3 ‘ where A is the modulus of the spring and ¢ is the extension of the spring. While the object is moving up and down, its motion is controlled by: ma = mg — T (8.90) where m is the mass of the object, a is the acceleration of the object and g is eleration due to gravity. " ; : ° eat any time f, the mass has position y, velocity v and acceleration a, at a time t + At its new position yy’ relative to'the top of the spring is (8.91) ys yh vat The extension e is given by: * i 8.92) ein yi! and if this is substituted into (8.93): 264 Physical Simulation Simple* harmonic motion Figure 8.16 If a mass m is attached to a light spring it will oscillate with simple harmonic motion. 2 pene (8.93) ma = mg Ms . ‘ : : the: acceleration a is’ equal to: e See (8.94) S oetaialht ‘ and thé new velocity v’of the mas§ is equal to: ’ 8.95) ‘= vt adt If this value of v’is substituted back into (8.91) to develop a new value for ¥y, and continuously repeated, the trace of y is simple harmonic. The value of y can then be substituted into a matrix to subject an object to this motion. Perhaps one of the most useful features of this approach is that the model can be dynamically modified while it is running. Any of the above parameters can be interactively changed, resulting in an almost instantaneous change in the motion, 8.6.1 Restitution sal cat Vi As there is no loss in this model, the simple harmonic motion continues indefinitely. If the motion is required to decay to zero, a restitution term ks an be introduced in (8.95) as follows: kot adt Oka <1 pee a 6.90) When k, = 1, the motion continues unchecked, but when k, < 1, the motion decays away, dit thio httiee ‘ s, 8.6 Sprins 265 8.6.2 Moving springs ons Figure 8.17(a) show: ae a io te 3 spring of length / connected to a wheel which can travel is less than unity, when the mae is a mass m. If the spring's restitution wette down to some sate s(n Placed on the spring it will oscillate and Mipjected to some een coulibriom, The mass will oscillate only if it is ‘One way of intr: i: . A eens a abuse eae force is to roll the wheel over an undulating ‘compressed and stretched, m 7). As the wheel rises and falls, the spring is jhass. The extra’ spri » Modulating the spring tension transmitted to the Pring compression h is the difference between the terrain eight sampled at f + Az and ¢. Initially h i the spring extension equation tee is set to zero and is introduced into emp ey Sp 6.97) where » is the height of the spring before the mass was added. The new set of equations then become: yay vat emo be e e (8.98) v'= kv + At H'= Iiggw — A Where fnew is the next value of A sampled at ¢ + At. When this algorithm is implemented, it produces very realistic motion. 8.6.3, Elastic structures We saw in Section 7.4 how free-form deformations (FFDs) are used by animators to’ form flexible objects. But if a sense of elasticity has to be introduced into the animation, the control points of the FFDs must be moved it it i i ‘1 of a spring to create with suitable dynamics. ‘We can use the dynamic model i this effect, but the ideas developed below have also been applied to model Flexible objects such as flags, carpets, curtains and tableciovhs (Miller, 1984; 4 ulos and Witkin, 1988; Weil, 1986). Sean Est be as a matrix of mass points connected together Fabrics can be modelled n n : c i hbouring mass using springs, i +h mass is connected to a nelg! f ae rae 8 18. The forces acting on the Ngee can be related to: ipon usi %5 second law of motion. upon using Newton's secon( on on Te ith ty ae technigue we will analyse the 2D case, ant will be left to ‘the reader to extend the ideas to the 3D domain, with reference to the papers cited. Consider the dynamic simulation of an elastic thread fixed at both ends. # 266 — Phisical Simulation Figure 8.17 (a) If a mass m is harmonic motion and settle down and falls, the mass attached to the extra forces caused by accelerating attached to a light spring it will move with simple to a state of equilibrium. (b) As the wheel rises free end of the spring will | subjéct the spring 0 the mass. 8.6 Springs 267 Figure 8.18 i ig Fabric can be represented as a mesh of mass poinis connected to cone another by stiff springs. The forces acting through these springs can be computed and used to move the ma ; material under the forces of gravity Point positions to simulate the behaviour of ene Oded (ins Fiadd iotrt 3 Gy) x Figure 8.19 . Given three mass points falling under the action of gravity (g), their changing positions in space can be determined by resolving the horizontal and. vertical force. components. This can be represented approximately by a sequence of mass. points. m connected to their neighbours with springs of length /. Now imagine that the. middle of the thread has been raised and allowed to fall under the action. of gravity. Hooke’s law implies that the spring’s extension is proportional to the applied force. It is these forces that need to be calculated, but first the spring i mputed. haar nneetts aieee te positions of the three mass points whose positions, are specified by: oy, Oita) Gan) The left- and right-hand lengths / and (xj419144) (8.99) and /, will be; aid yur 268 Physical Siriulation (8.100) hati-r— xP + Oi-1-) ° 8.101) = V(%i41 4)? + Ore — 9) te : i will be: and the left- and right-hand spring extensions ¢, and en 8.102) e=h-! and), egp=h—/ identit izontal and With the spring extensions known, we need to pestis re wring’ vertical components of the forces, which requires a kno’ ? angles. These are: 103) cos = (x) —x21)/h, sind = (yi ¥-1)/A, & ~ ‘ (8.104) 0086 = (X41 — 2) /Ie sind = (r141 — In & As the force exerted by a spring is proportional to is Sensi = stiffness S, the horizontal forces acting on the ith mass, using Newton’s secot Jaw of motion (F = ma), are: ‘may, = S(ex, cos d — e,, cos 8) se therefore: ? and [te Obes a), Ok | 8.106) m Uy A and a similar expression can be derived for the vertical acceleration: ct -3[4-9 Gini G-d ee) Ts 8.107) m Ik 4 a (8.106) and (8.107) describe the horizontal and vertical accelerations of the central mass point, and, we:now require to determine values of the x- small discrete distances in equally small time intervals, Acceleration is a measure of the rate of change of velocity, which in turn-is ‘a measure of the rate of change of displacement with time. On an incremental basis, the horizontal acceleration can be defined in terms of the horizontal velocity as follows: ale + a0) (1) ~ ar (8.108) where tis any point in time, ahd A/ is a sma emeit inf i . . 7 Incr nt fs at time ¢ + Ar is therefore: vt in f; The velocity Mall + AL) = a(t) + Atay 0 (8.109) but the velocity can also be defi ined as: 8.7. Flight dynamics of an aircraft oy(e) = 2b 8d) = xl) lo ar (8.110) therefore the new horizontal positio; i ich i require) is given by: n for the mass point (which is what we (t+ Ot) = x(1).+ atry(0) At fo, when ¢ = ry (t0) 8.111 0, the horizontal velocity and acceleration’ are zero: and a(t) =0 8.112) Therefore, we evaluate (8.106) relating horizontal forces with acceleration to discover the initial acceleration. This is substituted into (8.109) using some suitable value of Af and an initial velocity u)(0) of zero. The new velocity v,(¢ + AZ) is substituted in (8.111) to reveal the new position of the mid mass point. A similar process is applied to (8.107) to derive the vertical displace- ment. When both the x- and y-displacements are known, the position of the mid mass point is updated and the cycle repeated. Values of the stiffness S, the gravitational acceleration g, and the mass m will have to be selected to create the desired movement. When this algorithm is implemented, we discover that the central mass bounces around with a realistic sense of elasticity. In fact, as there is no oppor- tunity for energy loss, the system refuses to decay; however, this can be introduced by a restitution term in (8.109), similar to that used in (8.96). 8.7. Flight dynamics of an aircraft Hopefully, it requires little convincing that simulating the dynamic behaviour of a 100 ton aircraft taking off, flying and landing is a non-trivial exercise. Nevertheless, it is possible, and is a central component of a flight simulator. However, in this example we will not attempt to reproduce an actual flight simulator model, but will develop a simple flight model that could be used i within a VE. frame of an aircraft are complex and address the effects of the craft's aero- dynamic characteristics, engines, the atmospheric environment urease and hydraulic/mechanical control system used by the pilot to fly the aircraft (Rolfe, 1991). ee, it ec ic characteristics are affected by the vehicle’s weight, Ce ei al ravi, angle of tack, liht surface geometry and ground proximity effects. The forces transmitted throug! ber rearriage during take-off and landing are determined by the mechanieal, hydraulic and pneumatic assemblies associated with ree, es. Apart fom Simulstine ahece effects, the mathematical mode) ma), 0 eT dynamic behaviour of brakes, tyres and the nose-Wie : 269 270 Physical Simulation Figure 8.20 The traditional method of representing the axial system for an aircraft is a right-handed system with the Z-axis pointing downwards. Different types of aeroengines possess different dynamic characteristics, They have varying thrust profiles and capacities; they burn fuel at different rates; they have differing temperature/efficiency characteristics and differing Tesponse patterns. Z 4 The atmospheric model reflects the variation of air density and tem- perature with height. Wind speed must be included as it can significantly affect a plane’s true ground speed, as well as modify the craft’s behaviour during landing and take-off. Wind shear, which creates highly dangerous flying conditions, must be modelled, and even the turbulence caused by large planes must be simulated as it can seriously affect the aerodynamics of planes following in their wake. The mathematical techniques used to simulate such a complex system can be only an approximation of reality. But our understanding of these numerical simulation models is such that their accuracy and fidelity allow them to play a significant role in flight simulators. As this level of detail is relevant only to flight simulation, let us examine a simple first-order aircraft model. \ 8.7.1 A simple aircraft model Figure 8.20 shows the traditional method of representing the axial frame of reference. for an aircraft. It is tight-handed, with ‘the’ z-axis directed downwards. For the sake of consistency the axial system will be modified to conform with the examples in the rest of the book. » A first-order model for approximating an aircraft assumes that it is a point without mass, travelling with speed v in its body-fixed z-axis, and velocities v, and v, in the x- and y-axes Tespectively, as shown in Figure 8.21(a), The heading ¢ is specified by the angle between the z-axes of the aircraft and the WCS, as shown in Figure 8.21(b). For the moment, the aircraft 1s not allowed to yaw, pitch or roll. Given the aircraft's position (x,y,z), speed'v, acceleration a, and heading 8. 7 Flight dynamics of an aircraft 271 (b) beayile ag’artl (Sck.8Y Xw EAE.) Figure 8.21 (a) A first-order flight model for an aircraft assumes that the craft is with instantaneous velocites Y; Ux and vy. (b) This plan a'point without mass, fefinition of the heading angle $. ‘elevation shows the di seaviy wk col By ¢, its new position (x4952')s after time At can be computed as follows. The incremental distance 4d moved forward is given by: agai VON , ‘hd = vAt+ 40a? 5 (8.113) The, corresponding increments 4 and Az in the x- and z-axes are given by: (8.114) Ax = Adsing 272 ~~ Physical. Simulation 1 Az = Adcosé easy then: (8.116) * A. Be ae @.117 waztaz In order to compute a new altitude, air speed and heading, we can assume that an agent, such as an autopilot, is regularly providing a new demand altitude yg, demand speed v, and demand heading ¢a- Altitude bi / The new altitude y’ can be computed by first determining the altitude error Vere? Yer = Ya Y (8.118) The new vertical velocity vj then becomes: (8.119) Wy = kerr —Vaes $ YS Vai where k, is some gain factor; —Vg, is the maximum descent rate, and Va, is the maximum climb rate. If y,q is below some threshold value, altitude acquire is disabled. The change in altitude is then given by: Ay = vat (8.120) and the new altitude y’ becomes; yoaytay N " (8.121) Acceleration ‘ 4 The new acceleration a’ can be computed by first determining the airspeed eLLOL Veg? : Yee = 0a 0 : (8.122) The new acceleration in the direction of travel then becomes: a! = Kyte Adee $0" € Agee (8.123) where k, is some gain factor, ~A4q is the maximum deceleration permitted, and A,,. is the maximum acceleration rate permitted, If Ver, is below some threshold value, airspeed ‘acquire is disabled. The new airspeed is given by: vo =vtast (8.124) Heading Finally, we come to the new heading 6’, Agai eee . : an we estab! the current heading and the demand heading lish the ere between ber = ba = 0 i iehy x 0 @.125) ‘The new lateral velocity v/ becomes: 8.7 Flight d i , aki Pm enew lynamics of an aircraft 273 where Ky is some gain factor and yj. (8.126) y=vtan(MAt), where M is the is the maximum lateral velocity, given by maxit standard turns). The change in heading is een tile (3° per second for given by: Ag = tan! G 7 (8.127) and the new heading $’ becomes: or =ot dd (8.128) After time A? the aircraft has positi raeenty , wid beading $- These become the tery Cdvet op (eo seen eratioe tively for the next time period Ar. = Of ayea)y 6, @ and @ reaper alone BERA Geet any ct Ges ook ee om about any of its axes, and there is nothing in the model to simulate the action of landing and taking-off. , One simple mechanism for introducing’a banking angle is to roll the aircraft about its z-axis by an angle proportional to the heading angle error deq+ It is left to the reader to develop the model further by introducing pitch, yaw, mass and gravity. "In reality, the Euler equations of a rigid body moving in a vacuum are used as a starting point for a flight simulator model. These are sensitive to the aircraft’s mass, the moments of inertia about the centre of gravity and the forces acting along the axes. Readers wishing to pursue this approach are forewarned of their .relative complexity, and the axial notation used, which is different to that used above. 9 Human Factors 9.0. Introduction It is ironic that the vast majority of computer users operate their systems via terminals that were designed for mechanical typewriters at the turn of the last century. But apart from this mechanical anomaly, computer keyboards have keys marked ‘Ctrl’, ‘Alt’, Esc’ and ‘Alt Gr’, whose meaning is known only by computer engineers! All that typical users know is that if they simultaneously press the ‘keys ‘Ctrl’, ‘Shift’ and ‘W’, the current word is underlined! It is dif- ficult to imagine that anyone could have designed an interface with a greater disregard for human factors. However, the very idea of designing an interface to replace the current one is almost unthinkable, as there are just so many machines around the world and software packages in use that we have no choice but to continue with these keyboards. Many keyboards in use do not eyen take into account the way humans sit at a table and hold their hands over the device. This is a problem for people who spend most of their working life as keyboard operators, and are now discovering the effects of repetitive strain injury (RSI). Similarly, we know very little about the long-term effects of working at computer screens for long periods of time - and only time will tell if, and how, we have been ignoring certain human factors in these vital areas of design. d YR proposes a totally new interface for human-computer interaction. An interface where the keyboard is replaced by interactive gloves and 3D mice, and the computer screen is replaced by a head-slaved, head-mounted display. As we have the chance of starting from scratch, there are no excuses for getting it wrong. We are under no obligation to incorporate out-of-date technologies Or concepts unrelated to the task in hand: ante hk ane eet system designers cannot afford to ignore vital Physiology, details of which are available from any modern . 9.1 The eye medical textbook, It is highly unlikely that earl Se tr a gt tm Of reasons, designing i egocten, i ig and implementi : system today may not be possible. To begin with, certain Con ee they do exi comune, it systems. Four areas of hi hysi logy are examined: the eye, th ‘i 5 RED DAVES eens ‘Ye, the ear, somatic sensations and the sense of 9.1 The eye See A knowledge of the eye is very important if we are to understand how its abuse can be minimized by VR display technology. The eye is a highly developed organ and its action is well documented. But for this diversion we will explore only those features and characteristics relevant to the design of display systems. Figure 9.1 shows a diagrammatic cross-section of the human eye identi- fying'the cornea, the aqueous humor, the crystalline lens, the vitreous humor and the retina. All of these play an important role in forming an image that starts the process of seeing. Apart from the retina, they collectively provide an optical element that refracts light from an external object such that it is focused onto the retina upside-down and inverted. This double ‘twist’ to the image seems to cause no problem for the brain, which is able to integrate it with other sensory mappings of the external world. ) © The refractive power of an optical element is measured in units of dioptres, where a 1 dioptre lens can focus a beam of parallel light at a distance of I metre. The refractive power of the human eye is about 60 dioptres, which implies that all of the compound elements of the eye can be replaced by a single virtual lens 17 mm in front of the retina. What is surprising about the eye's action is that the refractive power of the lens is only 20 dioptres. Most of the refractive power comes from the boundary of the cornea with air. 9.1.1. Accommodation ‘ 1s is flexible, and its refractive power can 14 dioptres by tensioning or ae the = A jphery. This is called accommo lation or sy nee aia i oni for obtaining deat images fom at tant obec ‘as well as those close tO. With age, the lens ecm jane an thioher ead unfortunately, less flexible Tt §5,ROt HORemMmoR TORUS EP A young and healthy crystalline le be continuously varied by about 275 276 Human Factors Vitreous humor Fovea Optic nerve Figure 9.1, Cross-section of the human eye ‘of accommodation to reduce to 2 dioptres by the age of 50, and zero by the age of 70! This is called presbyopia, and results in'a person having to focus at a constant distance, # When we focus upon a moving object, an automatic feedback mechanism attempts to keep the image in focus by dynamically changing the refractive power of the crystalline lens, Although there is no definitive explanation for this process, it has been found that the lens is permanently oscillating slightly up to 2Hz. This results in an image that continuously moves in and out of focus. It is thought that this modulation of the lens plays some Part in the nervous system’s hunting fora clear image. by Although we possess this extraordinary skill to focus upon objects at dif. ferent distances, it is not exploited in HMDs. However, our ability to keep parts of a scene in clear focus while others are blurred is an excellent filtering mechanism, as it allows us to concentrate upon a specific zone of our field of view (FOV) without being unduly distracted by activity outside this area Most HMDs provide two images, Permanently focused between 2 and 3 metres, This would be acceptable if the image content corresponded to this spatial depth of field, which is rarely the case. gecurs. We are now faced with viewi Pah ff clear focus, with all the light r akes it impossible to resolve the Soject located in the distance, T jimated to 2 metres or so. But as. such as rooms, the conflict is ring is scant containing near and far objects scene, and het conflict of information ne renga the cup appears tbe a colossal typical ce iappens in an HMD that is col: oe tual worlds are local: ‘environments, se agin a VR system provide ms te: Furthermore, head- and hand- a ae fecessary motion parallax cues one would si fs jects, . fous, it is something that can be Spee although the entire scene is in clear 9.1.2. The pupil The iris is a pigmented opaque structure positioned in front of the crystalline lens, and it contains a hole through which light passes. The ole: or pupil changes in size under different conditions. The size variation is wasveet approximately 1.5mm and 8mm in diameter, which gives an area ratio of 1:30. As the eye has a sensitivity to light in the order of 1 000 000: 1, the pupil size has little effect on controlling the amount of light centering ie he Gregory (1979) points out that the principal functions of the iris are to: : (1) Increase depth of field for near vision by contracting. (2) Confine incoming light to the central and optically best part of the lens by-contracting. 0)’ Maximize eye sensitivity by opening. If light levels are low, pupil size increases with a corresponding loss of depth of focus. : 9.1.3. The retina The retina is the light-sensitive surface attached to the reat of the eye, and is several: hundred microns thick, with 10 distinct layers. Light incident on the he aqueous humor, the lens, the vitreous humor and Finally trikes eee It then hhas to traverse 8 of the retina’s 10 layers before it is absorbed by the rod and cone photoreceptors. The rod photoreceptors are responsible for low-acuity, monochrome, night vision, while the cones ae for high-acuity, colour, day vision. It takes 25 ms to turn ght ln 8 ea a signals, which then have to be interpreted by the brain's visual cortex. is , ny problems with serra life, bu thee are occasions when this time delay prevents us from responding to certain events, ee for example, a tennis player pecving hi a 2 ial i a ine ian 355 za, and a tt tal is. 1.4m away from where all other delays in the visual system» the eons all fa Ye He Mh a ee i rae already os covered in Section 3:7 As the action of rods an nt 277 278 — Human Factors it will not be repeated again. Nevertheless, it is worth completing this descrip. tion with some information on the fovea. This is the highly sensitive central part of the retina and accounts for the high-resolution portion of our FOV, Its existence is easily confirmed by staring at a particular word on a page of text. Here it can be observed that surrounding text is difficult to read unless the eye is moved: What is happening is that the eye is being rotated by motor reflexes to capture on the fovea the light rays from a required point in space. As the fovea is only 0.1mm in diameter and contains the highest density of cones in the retina, only the centre part of our FOV is seen in high resolution, The remainder of the image is projected onto the surrounding retina which contains a mixture of rods and cones with a lower spatial resolution. Not only are the cones packed closer together at the fovea, but they are finer than the cones distributed over the rest of the retina. This also con. tributes to the extra visual acuity of the fovea. Although the fovea provides as with high-resolution colour vision, the existence of rods, albeit at a reduced distribution, provides a consistent image field for night vision. ‘As the fovea is so small, it accounts for only approximately 1° of our FOV. This has been exploited in the display systems of some military dome simulators, where the pilot’s head and eye are tracked to identify the central field of view. A single projector forms a high-resolution elliptical image on the dome’s surface to cover the pilot's foveal area completely, while other pro- iectors display the remainder of the scene in a lower resolution. This reduces the rendering load on the image generators, but does require head- and eye- tracking hardware, and the careful integration of the two image formats. 9. 1.4. Visual acuity Like any other optical system the eye has limitations, and one that is important to display systems concerns visual acuity, The eye’s ability to distinguist between two external points of light is limited to approximately 1.5-2 mm a’ a distance of 10m. This measure of visual acuity is often specified in terms of the angle subtended to the eye by the light points. For the average eye this 5 about 40 seconds of arc, and corresponds to a separation of 2 microns on ¢ retina. 9.1.5. Light and dark adaption The luminous sensitivity of the eye is automatically adjusted by slight changes in concentration of the photosensitive chemicals in the rods and cones. We notice this phenomenon when we move from bright sunlight into a dark room Although we appear to become accustomed to the new ambient light quickly it can take as long as 40 minutes before we are completely adapted. This * called dark adaption. Moving from a dark Toom back into bright sunligh! the reverse happens - this is called [i : led led light adaptic i in eye Sensitivity through adaption ‘is in ¢] iption. The relative change ! he order of 25000:1. Rods can take ”

You might also like