Fw: [vtkusers] Glyph3D questions

Roger Blum rogerblum at hawaii.rr.com
Tue Aug 30 03:44:58 EDT 2005


----- Original Message ----- 
From: "Roger Blum" <rogerblum at hawaii.rr.com>
To: "John Biddiscombe" <biddisco at cscs.ch>
Sent: Monday, August 29, 2005 3:50 PM
Subject: Re: [vtkusers] Glyph3D questions


> Hello John,
>
> Thanks for your answer.
> I have been trying to make it work, but had no succes till now.
> I haven't mentioned in my posting that I use vtk 4.4.2 and script it with 
> Tcl.
>
> After searching all of the examples I still cannot figure out, how to 
> supply
> the extra information (a color index, a type index and a direction) to the
> vtkGlyph3D object.
> The method you supposed "SetInputArrayToProcess" doesn't seem to
> exist (in this version of vtk?).
> So how does vtkGlyph3D know which type of glyph and color to assign
> to a node? How do I have to construct the input for vtkGlyph3D?
>
> I've also checked the source code vtkGlyph3D.cxx and it seems to only
> use one scalar value for the scaling, indexing and color selection. Is 
> this
> correct? If yes, I wouldn't be able to do what I want then. I would have
> to create one Glyph3D per type or per color.
>
> Thanks again for your help,
> Roger
>
> ----- Original Message ----- 
> From: "John Biddiscombe" <biddisco at cscs.ch>
> To: "Roger Blum" <roger_blum at swissonline.ch>
> Cc: <vtkusers at public.kitware.com>
> Sent: Thursday, August 25, 2005 9:23 PM
> Subject: Re: [vtkusers] Glyph3D questions
>
>
>> Using vtk from recent CVS (glyph3D has changed a lot since vtk4.4), to 
>> display a different object for each type, with a differnet colour, I use 
>> this snippet. In this case data scaling is off, but if you wanted to do 
>> scaling too then you can add another SetInputArrayToProcess call. 
>> Likewise for orientation. If you can't get orientation working, then ask 
>> me again and I'll have another look inside the glyph3D code, I cant 
>> remember if orientation can be specified separately from other scalars 
>> etc.
>>
>>    NodeGlyphs->SetInput(NodeData);
>>    NodeGlyphs->SetColorModeToColorByScalar();
>>    NodeGlyphs->SetScaleModeToDataScalingOff();
>>    NodeGlyphs->SetScaleFactor(0.25);
>>    NodeGlyphs->SetScaling(1);
>>    NodeGlyphs->SetIndexModeToScalar();
>>
>> NodeGlyphs->SetInputArrayToProcess(0,0,0,vtkDataObject::FIELD_ASSOCIATION_POINTS, 
>> "nodeTypes");
>>
>> NodeGlyphs->SetInputArrayToProcess(3,0,0,vtkDataObject::FIELD_ASSOCIATION_POINTS, 
>> "nodeColours");
>>
>>    for (int i=0; i<this->NumGlyphObjects; ++i) {
>>      NodeGlyphs->SetSource(i, this->GlyphObjects[i]);
>>    }
>>    NodeGlyphs->SetRange(0,NODET_MAX);
>>    NodeGlyphs->Update();
>>
>> In the above code, we assume that there is an array called "nodeTypes" 
>> and another "nodeColours" which is present on the pointdata of the 
>> NodeData object.
>>
>> JB
>>
>>
>> Roger Blum wrote:
>>
>>>Hello,
>>>
>>>I have checked the manual, examples and news list but couldn't find the
>>>solution to my problem.
>>>
>>>I would like to use a vthGlyph3D filter to display my data.
>>>For each glyph I have
>>>- a point (X,Y,Z)
>>>- a direction (X,Y,Z)
>>>- a color code (1,...,n)
>>>- a type code (1,...,n)
>>>
>>>With this information I would like to show the glyphs (type depending on 
>>>type code)
>>>with a specific color (depending on color code) at a position (point) 
>>>with a direction
>>>at a fixed size (not influenced by zooming).
>>>
>>>How do I have to set up and connect the needed objects so my vtkGlyph3D 
>>>object
>>>generates the desired output?
>>>
>>>Thanks for your help,
>>>Roger
>>>
>>>
>>>_______________________________________________
>>>This is the private VTK discussion list. Please keep messages on-topic. 
>>>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>> -- 
>> John Biddiscombe,                            email:biddisco @ cscs.ch
>> http://www.cscs.ch/about/BJohn.php
>> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
>> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages on-topic. 
>> Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list