
this is how result should look in the end. The question is, how can i calculate angle by which i have to rotate each of these prisms (i have function which draws single prism – height of prism and trapezoid are known)?
this is how result should look in the end. The question is, how can
Share
In this example you have 6 prisms so you can rotate prism by 60 degrees but case not be same for all time. So try to use the math formula to calculate the angle.
Lets take the example.
You have a
line (x1,y1,z1) to (x2,y2,z2)If you want to rotate it about z-axis then calculate the angle like this.which gives the angle of rotation about z-axis.
Now, rotating about y-axis:
Again, rotating about x-axis: