28.06.2013 Views

Papers in PDF format

Papers in PDF format

Papers in PDF format

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 2: Adjust<strong>in</strong>g the up vector of the avatar to the normal of the walk<strong>in</strong>g plane.<br />

// f<strong>in</strong>d closest object ’hitObject’ <strong>in</strong>tersect<strong>in</strong>g the ray emanat<strong>in</strong>g from<br />

// ’eyePo<strong>in</strong>t’ <strong>in</strong> direction ’dir’ return<strong>in</strong>g the distance to the <strong>in</strong>tersected<br />

// object <strong>in</strong> variable ’dist’. In case that no <strong>in</strong>tersection occurs<br />

// if ’hit’ equals FALSE all other variables rema<strong>in</strong> unchanged.<br />

hit = allObjs-><strong>in</strong>tersect(eyePo<strong>in</strong>t,dir,NULL,dist,hitObject);<br />

if (hit && dist-HEAD_DISTANCEsurfaceNormal(eyePo<strong>in</strong>t+dir*dist);<br />

// change user’s direction accord<strong>in</strong>gly<br />

if ( dot(dir*norm,up) < 0 )<br />

TurnRight();<br />

else<br />

TurnLeft();<br />

}<br />

2.2 Climb<strong>in</strong>g Stairs<br />

Another problem frequently encountered with 3D viewers is the <strong>in</strong>adequate support for navigat<strong>in</strong>g over uneven<br />

terra<strong>in</strong> or for climb<strong>in</strong>g stairs. Hav<strong>in</strong>g taken care of the collision problem mov<strong>in</strong>g on level ground can be mastered<br />

by most users without significant problems. But navigat<strong>in</strong>g on a slope or climb<strong>in</strong>g stairs adds an extra degree of<br />

navigational complexity and typically gives the user a hard time.<br />

An easy solution of keep<strong>in</strong>g the user at a constant distance over the ground is implemented <strong>in</strong> MRTSpace by<br />

cast<strong>in</strong>g two rays down to the ground: one ray before and one ray after each step. Both <strong>in</strong>tersections return a<br />

distance. If the difference of the distances is zero the user is considered to walk on flat ground and no special action<br />

is taken. If the difference is with<strong>in</strong> a small range the user is considered to take a step and the difference is added<br />

to the position of the user. If the difference is negative and with<strong>in</strong> a rather large range the user is considered to fall<br />

and the position of the user is decremented <strong>in</strong> several steps to the new level, giv<strong>in</strong>g the user the impression of a<br />

fall. If the distance of the new position towards the ground is too large, the user is either set to the fly mode or just<br />

stopped depend<strong>in</strong>g on some setup parameter. If the user is <strong>in</strong> fly mode, the cast<strong>in</strong>g of rays towards the ground is<br />

used to automatically switch back to the walk mode when the user lands on the ground.<br />

Once the scene structure is consistently exploited stay<strong>in</strong>g upright is not too difficult either. In this mode the<br />

viewer casts a ray down towards the object the user is mov<strong>in</strong>g on and calculates the angle between the surface<br />

and the up vector. If this angle exceeds a given threshold value the up vector is cont<strong>in</strong>uously set to the normal<br />

vector to the ground position. The most impressive example <strong>in</strong> terms of user comfort for this feature is a big ball<br />

represent<strong>in</strong>g a planet where the user has the ability to walk on this ball, the feet always stay<strong>in</strong>g on the ground and<br />

the gaze vector always parallel to the tangent plane.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!