[vtkusers] Beginner and his problems with rotation.
Kacper Pluta
kacper.pluta at gmail.com
Mon Aug 22 14:07:13 EDT 2011
At the beginning I would like to welcome you all!
Some time ago, precisely some days ago I started to learn VTK and I
encountered a problem with rotation. I wanna write a recursive function to
generate a tree in 3D. I generated a part of a tree, so you could see what I
mean.
Below is a pseudocode. So you can see from my point of view, and you may be
able to correct it.
I have a big problem with the setup of new children at a right angle at the
end of their root, after the restoration of the root angle, and angle of the
family to which it belongs.
NODE GenTree(NODE root, int bifurcation)
{
if(bifurcation > 0 && root != NULL)
{
Restart the angle of Parent root famili if exist;
//(root is part of the family, e.g. the left child of his Parent)
Restart the root angle;
//Now root agnel is set to 90 degrees
//make new bifurcation
Create the children;
Set children position to lower ends of root;
Set children origin to center of root;
rotate the children on Z axis;
restore root angle;
restore Parent of root famili angle;
//Make root famili
root->Famili = vtkAssembly::New();
root->Famili->AddPart(root->Left->BranchActor);
root->Famili->AddPart(root->Right->BranchActor);
Set Famili origin??
rootate the root famili?
//Now the family is at the end of the root.
root->Left->Left = GenTree(root->Left,--bifurcation);
//root->Left->Right = GenTree(root->Right,--bifurcation);
}
}
/**********************/
OS: OpenSUSE 11.4 x86_64
VTK VERSION: 5.6.1
cmake: 2.8.3
Language: C++
/**********************/
--
"If you build your empire on money, it'll fall like a house of cards, if you
build it on love, you've built Taj Mahal!" - Mark Hartmaier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110822/233c9b84/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zrzut ekranu10.png
Type: image/png
Size: 25509 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110822/233c9b84/attachment.png>
More information about the vtkusers
mailing list