I have a problem and i hope someone can help me out.
I have a cylinder in my scene, this cylinder can rotate around itself (over Y axis)
I want to draw 3 direct horizontal lines from center of this cylinder according to its rotation.
Each line make a 30 degree angle to previous one.(see the screen-shot to get the idea)
Assuming that length of each line is 500,
here is what i tried so far :
Code: Select all
For line 1:
Start point = Node->GetPosition();
End point = Node->getRotation().rotationToDirection()*500;
For next lines,
Direction = Node->getRotation();
Direction.rotateXZBy(30);
Direction = Direction.rotationToDirection();
Start point = Node->GetPosition();
End point = Node->getPosition()+ (Direction*500)
It seems it works (when rotation is zero) , but it doesnt
I know there should be an easy solution for this that i am not aware of. Im sure my approach is wrong and maybe silly.
Please help me understand my mistake and learn the correct way.
Kind regards
ben

