[vtkusers] Accessing polygon vertices from SphereSource

Sylvain Jaume jaume at tele.ucl.ac.be
Wed Dec 12 00:59:53 EST 2001


Hi,

vtkSphereSource creates a sphere model made of points, triangles, and 
normals. You can get the number of points with:
cout<<sphere->GetOutput()->GetNumberOfPoints()<<" points\n";
Verts are different from points. That's why you get 0 verts with your
program.

Hope this helps,
Sylvain

On Wed, 12 Dec 2001, hj wrote:

>     I meet a similar problem as Phil Cook. I have called the function Update, but my code still doesn't work.
>     The following is my code in VC6.0:
>  
>     vtkSphereSource *sphere = vtkSphereSource::New();
>     sphere->SetRadius(5.0);
>     sphere->SetThetaResolution(18);
>     sphere->SetPhiResolution(18);
>     sphere->Update();
> 
>     vtkPolyData *Data = sphere->GetOutput();
>     cout << Data->GetNumberOfVerts() << ',' 
>         << Data->GetNumberOfLines()  << ',' 
>         << Data->GetNumberOfPolys() << ',' 
>         << Data->GetNumberOfStrips() << endl;
>  
>     I get 0,0,576,0. Only GetNumberOfPolys give me the right answer.
>     Did I forget something important?
> 
>     Thanks a lot.
> 
>     J.Huang   
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÓ†+"²Ø^¦¸¯jוL§b±Ë¬²*'–+-üù^jǤyêfzˁë(Ÿûh¦'ÿ
> œ’Ø^·ÿá¶ÚÿÿúnnXœþH­ÁªÞýÊ&ýÈ"ý¸§þûd}ªÿ‰e£aŠÉbžKh²æìr¸›{û§²æìr¸›{øm¶Ÿÿþ››–'ÿ’+pj·ÿr‰¿™¨¥™©ÿ–+-ŠwèþûdºÇ«
> 




More information about the vtkusers mailing list