plotting coordinate axes in 3d plot

  • Follow


hi All

I am wondering if there is an efficient way to plot a coordinate axes (x,y, z unit vectors from common point) at a point in a 3d plot.

I am looking to plot the position and orientation of multiple coordinate systems on a single plot.

Thank you for your help

Conor
0
Reply Conor 3/18/2010 7:21:04 PM

Conor Walsh wrote:

> I am wondering if there is an efficient way to plot a coordinate axes 
> (x,y, z unit vectors from common point) at a point in a 3d plot.

The vectors themselves:

plot3(x0+[0, 1, nan, 0, 0, nan, 0, 0],
       y0+[0, 0, nan, 0, 1, nan, 0, 0],
       z0+[0, 0, nan, 0, 0, nan, 0, 1] )

The annotations:

text([x0+1, x0, x0], [y0, y0+1, y0], [z0, z0, z0+1], ['+X';'+Y';'+Z']);


 > I am looking to plot the position and orientation of multiple
 > coordinate systems on a single plot.

The above could be adapted, by using bsxfun, to do all the lines at once for a 
given list of [X,Y,Z] origins. Probably could do all the annotations at once 
as well by tossing in a repmat() .
0
Reply Walter 3/18/2010 7:40:50 PM


This is awesome, would u please be so kind to explain, where the nan and the additional zeros come from?

Thanks!

Walter Roberson <roberson@hushmail.com> wrote in message <hntvk4$lim$1@canopus.cc.umanitoba.ca>...
> Conor Walsh wrote:
> 
> > I am wondering if there is an efficient way to plot a coordinate axes 
> > (x,y, z unit vectors from common point) at a point in a 3d plot.
> 
> The vectors themselves:
> 
> plot3(x0+[0, 1, nan, 0, 0, nan, 0, 0],
>        y0+[0, 0, nan, 0, 1, nan, 0, 0],
>        z0+[0, 0, nan, 0, 0, nan, 0, 1] )
> 
> The annotations:
> 
> text([x0+1, x0, x0], [y0, y0+1, y0], [z0, z0, z0+1], ['+X';'+Y';'+Z']);
> 
> 
>  > I am looking to plot the position and orientation of multiple
>  > coordinate systems on a single plot.
> 
> The above could be adapted, by using bsxfun, to do all the lines at once for a 
> given list of [X,Y,Z] origins. Probably could do all the annotations at once 
> as well by tossing in a repmat() .
0
Reply jan.kappen (1) 9/10/2012 12:17:07 PM

2 Replies
565 Views

(page loaded in 0.04 seconds)

Similiar Articles:













7/23/2012 4:34:34 PM


Reply: