I try to generate a 3Dpoly made of short gluCylinders, in one
dimension it works:
But with 2 or 3 dimesion I get unexpected results.
So, please tell me: What do I have to learn ?
Please describe what expected result is.
What I see in your code is;
- Translate the cylinder to (x,y,z) first
- then Rotate it alpha degree about Y-axis
Do you want to ratate first then translate?
If then, swap the order of your transforms.
thank you for your help. I feel encouraged to describe my problem in detail.
I want to have a method that draws a steric polyline. I did it former with POVRAY, it’s easier,
there you define a cylinder with a base point and a top point.
My my method is declared as following :
- void drawPolylineWithVertices; NSArray* arr
The related part of the definition is :
for//i=0;i< arr count-1;i++//
get arr objectAtindex:i
extract point array to x, y and z
calculate arcs alphaXY, alphaXZ with point i and i+1
Rotation of the cylinder at the origin
around Y-axis with alphaXZ
around Z-axis with alphaXY
then translate from the origin to x,y,z
I use for test three sinus functions at the three axes, you can recognize function , translate is O.K. , but the cylinders do not
point from i to i+1.
Can you see what’s wrong ?