[vtkusers] Re: Help me please I am pupil :)
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Tue Apr 11 16:58:53 EDT 2006
Jose David Pfuturi Huisa wrote:
> hello all. I am from Peru. I speak Spanish.
> I wanted to know as I can create own functions in vtk. That is to say,
> that class receives the function. For example if I want to draw f=x*x+5
> or others.
> cant i user VtkImplicitFunction????
> Where i write the function???
> thank you very much to all.
Hello there in Peru!
I think vtkQuadric (http://www.vtk.org/doc/release/5.0/html/a01940.html
) will do what you want. A quadric is:
F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x +
a7*y + a8*z + a9
so for your expression, f = x*x + 5
you'd try:
quadric->SetCoefficients(1,0,0,0,0,0,0,0,0,5);
To visualize the function have a look at
VTK/Examples/ImageProcessing/Tcl/Contours2D.tcl
hth,
Goodwin
More information about the vtkusers
mailing list