Search code examples
graphics3dwolfram-mathematicamathematica-8

Line Style using Graphics3D in Mathematica


Consider the following :

cAxes = {{{0, 0, 0}, {0, 0, 1}}, {{0, 0, 0}, {0, 1, 0}}, {{0, 0,0}, {1, 0, 0}}};

Graphics3D[{Line /@ cAxes}, Boxed -> False]

enter image description here

How can Style differently the 3 lines ?


Solution

  • The answer above are good, but I want to show some alternatives.

    I show that it is possible to use Style for this, and that Tube is an interesting alternative to Line.

    cAxes = {{{0, 0, 0}, {0, 0, 1}}, {{0, 0, 0}, {0, 1, 0}}, {{0, 0, 
         0}, {1, 0, 0}}};
    
    tubes = Tube@# ~Style~ #2 & ~MapThread~ {cAxes, {Red, Green, Blue}};
    
    Graphics3D[tubes, Boxed -> False]
    

    enter image description here