Top Banner
YARCA YET ANOTHER RAYCASTING APPLICATION Michele Pilloni Elda Paja Davide Mottin PROJECT REPORT FOR COMPUTER GRAPHICS COURSE
28

YARCA (Yet Another Raycasting Application) Project

May 11, 2015

Download

Education

The scope of this project is to extend NASA’s World Wind to make it possible to visualize ray casting not only in intersection with the terrain, but also to consider 3D objects, which we call barriers, that will be hit by rays emitted by other objects which we call transmitters, calculating the coverage area and field of view of the transmitters and showing how the transmission signal is reflected onto the objects’ surfaces.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: YARCA (Yet Another Raycasting Application) Project

YARCAYET ANOTHER RAYCASTING APPLICATION

Michele Pilloni

Elda Paja

Davide Mottin

PROJECT REPORT FOR

COMPUTER GRAPHICS COURSE

Page 2: YARCA (Yet Another Raycasting Application) Project

PROBLEM STATEMENT

The scope of this project is to extend NASA’s World Wind to perform ray casting both on the

surface of the world and on arbitrary 3D objects.

Page 3: YARCA (Yet Another Raycasting Application) Project

YARCA ENVIRONMENT

Page 4: YARCA (Yet Another Raycasting Application) Project

SYSTEM ARCHITECTURE

Page 5: YARCA (Yet Another Raycasting Application) Project

RAY CASTING

Ray casting on the terrain

Ray casting on arbitrary 3D objects

Page 6: YARCA (Yet Another Raycasting Application) Project

RAY CASTING ON THE TERRAIN

Transmitters

Ray Casting Technique

Ray Casting with barriers

Groups of transmitters

Page 7: YARCA (Yet Another Raycasting Application) Project

TRANSMITTERS

3D model objects of two types: Antennas BulbsThey support different types of signals (i.e. linear,

Gaussian, etc…)

To manage transmitters, associate: A sector, as big as the coverage area of their

signals A matrix which is mapped to the sector A sector image to represent the coverage area of

the transmitter The color of the image will vary in compliance with the

values of the matrix

Page 8: YARCA (Yet Another Raycasting Application) Project

RAY CASTING TECHNIQUE

Page 9: YARCA (Yet Another Raycasting Application) Project

RAY CASTING ALGORITHM

Page 10: YARCA (Yet Another Raycasting Application) Project

RAY CASTING ALGORITHM

Page 11: YARCA (Yet Another Raycasting Application) Project

GROUPS OF TRANSMITTERS

We can put more than one transmitter on the terrain.

Different types of transmitters transmit different types of signals

In case we have signals of the same type that are within the coverage area of one another, they intersect.

Except for the intersection, the resultant transmission is also computed and this is shown graphically using a more intensive color.

On the other hand, signals of different types cannot intersect with one another, even if they were close together.

Page 12: YARCA (Yet Another Raycasting Application) Project

o The values of the resulting matrix containing all the given matrices will be calculated as:

GROUPS OF TRANSMITTERS: MATRIX COMPUTATION

o We focus our attention in the intersection area:

Page 13: YARCA (Yet Another Raycasting Application) Project

GROUPS OF TRANSMITTERS: MATRIX COMPUTATION

1. Compare t1 with t2. If they intersect, compute resulting matrices

setting the resulting value in the intersection part for t1 and 0 in that of t2.

o Computation is performed on pairs of matrices:

Page 14: YARCA (Yet Another Raycasting Application) Project

2. Repeat step 1 with ti for i = 1 … n

3. Repeat comparing ti for i = 2 … n and ti+j for j = 3 … n, until no comparisons are needed

4. Compute images starting by the matrices

GROUPS OF TRANSMITTERS: MATRIX COMPUTATION

Page 15: YARCA (Yet Another Raycasting Application) Project

WHY GROUPING TRANSMITTERS?

The main problem of casting each image individually was that the borders were not so well defined, mainly because world wind performs some operations, to improve the quality of the textures such as Gaussian filtering.

This kind of indexing and grouping offers great flexibility when moving, adding, removing, or stopping a transmitter, updating the current view accordingly, coming out with an high quality texture

Page 16: YARCA (Yet Another Raycasting Application) Project

RAY CASTING ON 3D OBJECTS

Barrier Layer

Compute texture

Texture mapping

Multipass Texture Mapping

Page 17: YARCA (Yet Another Raycasting Application) Project

BARRIERS

Barrier is an object containing:

a sector for the extent of the object base that is a world wind object, and

the barrier itself that is a Model to render a 3D object using openGL primitives.

Page 18: YARCA (Yet Another Raycasting Application) Project

BARRIERS

Directionable Barriers

bounding box as a sphere can distinguish which of their faces are

illuminated by the transmission and which are in shadow

can determine which is the nearest point to the transmission center define the near plane

Page 19: YARCA (Yet Another Raycasting Application) Project

COMPUTE TEXTURE

o To perform ray casting on the object surface the transmitter needs to know for each barrier b:

At what distance b is positioned

For each point of the base sector of b, the maximal height to which the transmission can reach

Whether there are other barriers that can hide totally or partially the transmission on b.

Page 20: YARCA (Yet Another Raycasting Application) Project

COMPUTATION OF THE DISTANCE FROM THE TRANSMITTER TO THE BARRIER:

Set the frustum, defining the eye position, the eye direction, which is from the transmitter

to the centroid of the barrier, the up vector, and the near clipping distance.

Page 21: YARCA (Yet Another Raycasting Application) Project

MAXIMAL HEIGHT TO WHICH THE TRANSMISSION CAN REACH

Split the cone of transmission into an infinite number of circles

Choose one of this circles and assign it a color

Looking at the direction and position where the barrier is supposed to be prospectively through this circle we can see the extension of the transmission for that particular perspective

Save such information in what we call a “stencil” buffer, that is color buffer used as a mask and is represented by the selected circle

All the values of the stencil buffer that do not coincide with the given color of the selected circle, are considered to be out of the transmission area, as they are higher than the maximum transmission height

Page 22: YARCA (Yet Another Raycasting Application) Project

RAY CASTING ON BARRIERSALGORITHM

For each Transmitter For each Barrier with center ≤ transmission radius

1. set the frustum based on the bounding box

2. calculate the “stencil buffer” and save it

3. clean the color buffer

4. calculate depth buffer and save it

5. disable depth test so that nothing is overwritten in the depth buffer

6. render other barriers starting from the most distant, in order to know whether there are other barriers in front of the one that is being considered and read values from the color buffer.

7. Calculate the texture by combining the information taken from the three buffers.

Page 23: YARCA (Yet Another Raycasting Application) Project

Textures are images that are mapped in a 3D world In our case, textures are images representing the

transmission area

To perform the texture mapping we need to map texture coordinates to vertices of the object that define the face where the texture will be mapped Generate texture coordinates Automatically using glTexGen. Determine the positioning of the different

sides/faces of the object wrt the transmitter.

TEXTURE MAPPING

Page 24: YARCA (Yet Another Raycasting Application) Project

DETERMINE THE POSITIONING OF THE OBJECT FACES

Consider the normal vector of each face of the object and compute the scalar product between such vector and the vector of eye direction:

If the product is positive, it means that the angle between the two vectors is less than 90°, and texturing should be enabled.

Otherwise, if the product is negative, the angle is greater than 90°, and texturing should be disabled.

Page 25: YARCA (Yet Another Raycasting Application) Project

MULTIPASS TEXTURE MAPPING

For every barrier that has to be rendered and has a texture on it:

If the barrier has not been rendered before, draw it normally and map the texture on it;

If the barrier has been already rendered, draw a fully transparent barrier over it with only the texture visible: Blending technique is used.

Page 26: YARCA (Yet Another Raycasting Application) Project

MULTIPASS TEXTURE MAPPING

Multi Passing Scheme

Page 27: YARCA (Yet Another Raycasting Application) Project

FUTURE WORK

Further improvements

Increase computation velocity

Achieve better precision

Consider barriers of other shapes and dimensions

Consider flying objects

Adaption to the latest version of the world wind framework

Page 28: YARCA (Yet Another Raycasting Application) Project

CONCLUSIONS

The developed system solves problems regarding ray casting in world wind environment

It has a modular architecture that allows great expendability

The two proposed techniques are different approaches to this problem