[vtkusers] vtkPlaneSource, orientation, position w/ SetCenter & SetNormal
Tim Ricard
bnr_shp at yahoo.com
Mon Dec 5 21:25:53 EST 2005
Hello again users,
As I explained yesterday (below) I am having some problems defining a plane sources location. Should/would the following work? (note Vec3f is a vector class that supports the standard operators, ie +, *, etc...)
Vec3f pn(-1., 0., 1.); // normal not used
Vec3f pp(3., .0, -3.); // origin
//Vec3f pp(0., .0, 0.); // origin
Vec3f pu(-1.,0., -1.); // point 1 on plane, local to 0
Vec3f pv(0.,1.,0.); // point 2 on plane.
float lu = 200, lv = 150;
Vec3f p1(pp + (lu/2.)*pu);
Vec3f p2(pp + (lv/2.)*pv);
plane->SetOrigin(pp[0], pp[1], pp[2]);
plane->SetPoint1(pu[0], pu[1], pu[2]);
plane->SetPoint2(pv[0], pv[1], pv[2]);
This works fine with the origin is 0, 0, 0
But not when I change the origin to something else the plane is skewed. I would think that point 1 and 2 would be defined such that (p1-origin) x (p2-origin) would produce the palnes normal... that probably is the case I imagine, what am I doing wrong?
Thanks for your time.
-tim
Note: forwarded message attached.
---------------------------------
Yahoo! Personals
Let fate take it's course directly to your email.
See who's waiting for you Yahoo! Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051205/d823a1de/attachment.htm>
More information about the vtkusers
mailing list