In 3D or opengl mode can it be possible?(rotate with the line i set)still not slove!!!!

edited October 2013 in How To...

for example rotate with this line: (0,0,300,300)

Tagged:

Answers

  • See the rotate() function.

    The 2d Transformations tutorial is probably also relevant.

  • edited October 2013

    i said in 3D mode ..... i mean in 3D mode it only can rotate in X Y Z three direction can the rotate main axis be set by my self??? for examle set (0,0,300,300) as axis

  • edited October 2013 Answer ✓

    You mean like this?

    size(600, 600, P3D);
    float angle=1;
    rotate(angle, 300, 300, 0);
    rect(100, 100, 100, 100);
    
  • edited October 2013

    thanks,but what's 300,300,0?point?and that's mean the line across the (0,0,0) and (300,300,0)?

  • Answer ✓

    Yes, you are defining an axis between 0,0,0 and 300, 300, 0, and then rotating around that axis.

Sign In or Register to comment.