• Keine Ergebnisse gefunden

Exercise1(RaycastingFanShot, 5Credits ) DueDate19.05.201511:59pmsrinivas@cs.uni-bremen.de AssignmentonAdvancedComputerGraphics-Sheet3

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise1(RaycastingFanShot, 5Credits ) DueDate19.05.201511:59pmsrinivas@cs.uni-bremen.de AssignmentonAdvancedComputerGraphics-Sheet3"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Prof. G. Zachmann A. Srinivas

University of Bremen School of Computer Science

CGVR Group May 13, 2015

Summer Semester 2015

Assignment on Advanced Computer Graphics - Sheet 3

Due Date 19. 05. 2015 11:59pm srinivas@cs.uni-bremen.de

Exercise 1 (Raycasting Fan Shot, 5 Credits )

Imagine a ray casting ”fan shot”, defined by a start vector (with starting point S and direction d) and angleα:

Figure 1: Fan shot view on one axis

The fan shot generates an equally distributed field of rays (see Figure 2), starting from the start vector, for the x and z axis (these are two vectors perpendicular to direction d) (applying the above illustrated scheme), whereas d shall be the pointing in direction y:

Figure 2: Complete fan shot

The fan shot shall be limited for each axis by a total of 90 degree as show in figure 1.

1. Give a pseudo code, which describes the generation of the fan shot rays

2. Implement your algorithm in C++. You can use the math template classes from the previous framework

3. Test your implementation with the following test cases and document your results:

• Start vector with S = (0, 0, 0), d = (0, 0, 1),α= 45

• Start vector with S = (0, 0, 0), d = (0, 0, 1),α= 30

Please note: Your code should consider the general case ( i.e. for any direction d and S) not only for d = (0,0,1) and S = (0, 0, 0).

1

(2)

Exercise 2 (BVHs for Ray Tracing, 5 Credits )

You implemented a simple raytracer with a recursive ray trace function, a camera, a phong lightning and intersection test. The scene objects are managed in a list and you test every ray against every object in the list.

Your tasks:

1. To accelerate the ray intersection test, we want to use a hierarchical data structure called bounding volume hierarchy (BVH). Propose a (good) algorithm (in your own words or pseudo code) which creates a BVH for ray tracing applications.

2. Consider the following two-dimensional scene:

• Triangle A = (-3, 3) B = (-1, 3) C = (-3, 1)

• Rectangle A = (-2, 3) B = (-1, 3) C = (-2, 1) D = (-1, 1)

• Circle r = 1 C = (2, 2)

• Triangle A = (0, 2) B = (0, 0) C = (2, 0)

• Triangle A = (1, 0) B = (1, -1) C = (0, -1)

• Triangle A = (0, -2) B = (0, -3) C = (-3, -3)

• Quad A = (2, -2) B = (3, -2) C = (2, -3) D = (3, -3)

3. Make a suitable two-dimensional sketch of the scene with bounding boxes

4. Build a BVH with your proposed algorithm (by hand - do not implement your algorithm) and give the resulting bounding volume tree. Argue why your bounding volume tree (respectively your proposed algorithm) is a good solution. (Remark: A good proposed algorithm has more advantages than a bad one)

Exercise 3 (On gradients/normals of implicit surfaces, 2 Credits)

1. Find the normaln(x) for the implicit surface given by the functionf(x) =x2+y2−z2 (hyper- boloid).

2. Prove that

∂xkx−xik= (x−xi) kx−xik

wherexi is a constant point in space. It is sufficient to calculate just one partial derivative, e.g.,

∂xkx−xikTip: try to writek · kin expanded form, then apply the chain rule.

2

Referenzen

ÄHNLICHE DOKUMENTE

You can assume that only primary rays are used (no shadow rays, no secondary rays) and that the complexity for one intersection between ray and scene costs log n, where n is the

The intersect() function of the acceleration data structures is called for the whole scene instead of the currently used intersect() from the SurfaceList class. As expected, it

Hint: Please note that the tiled version of Matrix Multiplication is used in the above given framework and use the similarities between algorithm EXTEND-PATH and Matrix

The fan shot generates an equally distributed field of rays (see Figure 2), starting from the start vector, for the x and y axis (applying the above illustrated scheme), whereas z

EBSD images with a colored overlay and an associated quartz c-axis orientation plot are indexed for each sample grid.. These c-axis orientation plots are oriented with their

Even though the space of the community is only symbolic (there is no concrete place as a community center su as in the case of Berlin), there are a number of alternative places

In the present thesis, we consider the possibility of a reconstruction of the coronal magnetic field by tomographic technique based on possible coronagraph observations of the Hanle

The gap distance and relative orientation of the glass surfaces is monitored with three non-contact distance sensors on the upper part, which sense the aluminum surface on the