sources:
BOX.CPP (3.1k)
BOX.H (507 bytes)
RAY.CPP (609 bytes)
RAY.H (604 bytes)
SPHERE.CPP (1.9k)
SPHERE.H (564 bytes)
TRIANGLE.CPP (2.1k)
TRIANGLE.H (1.2k)
UTIL.H (1.7k)
VECTOR.CPP (1.6k)
VECTOR.H (5.0k)
cgapplication.cpp (3.2k)
cgapplication.h (3.5k)
cgraytracer.cpp (18.8k)
cgraytracer.h (1.6k)
shape.h (754 bytes)


binaries:
Release/raytracer.exe (38.0k)


website:
more info here


screenshot:
studies/grafik2/Computergrafik-Code6/Aufgabe17/shape.h
download file

  1 #ifndef _SHAPE_H
  2 #define _SHAPE_H
  3
  4 #include "ray.h"
  5
  6 // abstrakte 3D-Shape Klasse
  7 class Shape {
  8 public:           
  9     // intersect
 10     virtual bool intersect(
 11                 const Ray& ray,
 12                 Vector& point,
 13                 Vector& normal,
 14                 double& distance)
const = 0;
 15         // 'intersect' berechnet den naechsten Intersektionspunkt
 16         // zwischen Strahlursprung und Shape. Im Fall eines
 17         // Treffers wird in 'point' der Intersektionspunkt, in
 18         // 'normal' die normale an der Stelle eingetragen und
 19         // true zurueckgegeben. Die Distanz wird in 'distance'
 20         // gespeichert. Trifft der Strahl nicht, wird 'false'
 21         // zurueck gegeben.
 22 };
 23
 24 #endif // _SHAPE_H
 25