Commit 4f29a02c authored by Will Schroeder's avatar Will Schroeder
Browse files

Initial revision

parent c2337989
/*=========================================================================
Program: Visualization Library
Module: Plane.hh
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Object for computation on plane
//
#ifndef __vlPlane_h
#define __vlPlane_h
#define TOL 1.e-05 // Tolerance for geometric calculation
#include "Object.hh"
class vlPlane : public vlObject
{
public:
vlPlane() {};
char *GetClassName() {return "vlPlane";};
int ProjectPoint(float x[3], float origin[3], float normal[3], float xproj[3]);
};
#endif
/*=========================================================================
Program: Visualization Library
Module: Plane.cc
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "Plane.hh"
#include "vlMath.hh"
int vlPlane::ProjectPoint(float x[3], float origin[3], float normal[3], float xproj[3])
{
int i;
vlMath math;
float t, xo[3];
for (i=0; i<3; i++) xo[i] = x[i] - origin[i];
t = math.Dot(normal,xo);
for (i=0; i<3; i++) xproj[i] = x[i] - t * normal[i];
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment