From Ohm

Edge Intersection with C++

With C++ we use the v3d.h vector header as part of the frame work to represent 3D vectors as C++ object.

#include "v3d.h"

The vector header also provides overloaded vector operators +, - and *. For example the addition of two vectors c=a+b is written as:

v3d a(1,0,0),b(0,1,0);
v3d c=a+b;

The intersection point of an iso line for the iso value v with an edge given by the endpoints x1 and x2 and the respective scalar values s1 and s2 is written as follows:

v3d x1,x2;
double s1,s2;

double w = (v-s1)/(s2-s1);
v3d p = (1-w)*x1 + w*x2;

Retrieved from http://schorsch.efi.fh-nuernberg.de/roettger/index.php/MedicalVisualization/EdgeIntersectionsWithC

Page last modified on December 03, 2015, at 02:12 PM