Commit e6d384e5 authored by Jan Möbius's avatar Jan Möbius

Added internal constants for defining cylinder axis and sizes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15102 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8d9e8ead
......@@ -46,6 +46,7 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ACG/Geometry/Algorithms.hh>
PrimitivesGeneratorPlugin::PrimitivesGeneratorPlugin() :
triMesh_(0),
......@@ -268,6 +269,12 @@ ACG::Vec3d PrimitivesGeneratorPlugin::positionOnCylinder(int _sliceNumber, int _
const double height = 5.0;
const double ringRadius = 1.0;
const ACG::Vec3d bottomPosition(0.0,0.0,0.0);
const ACG::Vec3d axis(1.0,0.0,0.0);
const ACG::Vec3d right = ACG::Geometry::perpendicular(axis);
const ACG::Vec3d left = cross( axis, right);
//double alpha = (M_PI / double(stacks_)) * double(_stackNumber);
double beta = ((2.0 * M_PI) / double(slices_)) * double(_sliceNumber);
......@@ -285,6 +292,8 @@ ACG::Vec3d PrimitivesGeneratorPlugin::positionOnCylinder(int _sliceNumber, int _
position[2] = height * double(stacks_ - _stackNumber -1 ) / double(stacks_-2);
}
position = bottomPosition + position[0] * right + position[1] * left + position[2] * axis ;
return position;
}
......
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