Thread Subject:
ginput for 3d plots?

Subject: ginput for 3d plots?

From: gegnal@gradient.cis.upenn.edu (Geoffrey Egnal)

Date: 14 Feb, 2002 19:02:41

Message: 1 of 6

I'm trying to create a user interface where the user can select points
on a 3D plot. I'm having trouble using ginput.

Here's what I have:

%plot original points
plot3(pts(1,:), pts(2,:), pts(3,:),'bo');
camproj(gca,'perspective')

%figure out the 2d projection of these points
[az,el] = view;
T = viewmtx(az,el);
tmp = T*[pts;ones(1,size(pts,2))]
%skip the rescaling because the 4th row is already 1

So, here's the problem - none of the resulting 2d points look anything
like what I get from ginput(1) and selecting a point.


Can anyone help me? btw - I'm running 6.1 r12 on WinNT.

Thanks,
Geoff

Subject: ginput for 3d plots?

From: gegnal@gradient.cis.upenn.edu (Geoffrey Egnal)

Date: 14 Feb, 2002 19:08:14

Message: 2 of 6


Nevermind. I just saw the above response which has the answer.

Thanks,
Geoff

Geoffrey Egnal (gegnal@gradient.cis.upenn.edu) wrote:
: I'm trying to create a user interface where the user can select points
: on a 3D plot. I'm having trouble using ginput.

: Here's what I have:

: %plot original points
: plot3(pts(1,:), pts(2,:), pts(3,:),'bo');
: camproj(gca,'perspective')

: %figure out the 2d projection of these points
: [az,el] = view;
: T = viewmtx(az,el);
: tmp = T*[pts;ones(1,size(pts,2))]
: %skip the rescaling because the 4th row is already 1

: So, here's the problem - none of the resulting 2d points look anything
: like what I get from ginput(1) and selecting a point.


: Can anyone help me? btw - I'm running 6.1 r12 on WinNT.

: Thanks,
: Geoff

--
Geoff

Subject: ginput for 3d plots?

From: gegnal@gradient.cis.upenn.edu (Geoffrey Egnal)

Date: 14 Feb, 2002 19:36:25

Message: 3 of 6

This has been a remarkable conversation with myself =)

It seems that select3d only works on meshes/surfaces. Is there any
tool out there to select random 3d points on a 3d plot?

Thanks,
Geoff


: Geoffrey Egnal (gegnal@gradient.cis.upenn.edu) wrote:
: I'm trying to create a user interface where the user can select points
: on a 3D plot. I'm having trouble using ginput.

: Here's what I have:

: %plot original points
: plot3(pts(1,:), pts(2,:), pts(3,:),'bo');
: camproj(gca,'perspective')

: %figure out the 2d projection of these points
: [az,el] = view;
: T = viewmtx(az,el);
: tmp = T*[pts;ones(1,size(pts,2))]
: %skip the rescaling because the 4th row is already 1

: So, here's the problem - none of the resulting 2d points look anything
: like what I get from ginput(1) and selecting a point.

: Can anyone help me? btw - I'm running 6.1 r12 on WinNT.

: Thanks,
: Geoff

Subject: ginput for 3d plots?

From: Joe Conti

Date: 14 Feb, 2002 16:26:30

Message: 4 of 6

gegnal@gradient.cis.upenn.edu (Geoffrey Egnal) writes:

> It seems that select3d only works on meshes/surfaces. Is there any
> tool out there to select random 3d points on a 3d plot?

Geoff:

Getting SELECT3D to work with line objects is a little more tricky
that patch or surface faces because line width and marker geometry
is defined in pixel space, not data space. It can be done in m-code
though, it's just more work.

But I think your needs can be met if some basic assumptions
are made. A simple algorithm would be to find the closest
line vertex in 2-D view space relative to the selection point.
This would ignore width properties, but it might just meet
your needs.

When I get a chance, I'll update SELECT3D on MATLAB Central
for simple line object support.

I should point out that full 3-D selection support is the MathWork's
wish list, but I'm hoping SELECT3D will satisfy most needs in the
mean time.

Regradless, keep those enhancement requests coming.

Joe Conti
The MathWorks

Subject: ginput for 3d plots?

From: gegnal@gradient.cis.upenn.edu (Geoffrey Egnal)

Date: 15 Feb, 2002 15:38:13

Message: 5 of 6


Perfect! Thanks for the fast reply.

Geoff


Joe Conti (jconti@madmax.mathworks.com) wrote:
: gegnal@gradient.cis.upenn.edu (Geoffrey Egnal) writes:

: > It seems that select3d only works on meshes/surfaces. Is there any
: > tool out there to select random 3d points on a 3d plot?

: Geoff:

: Getting SELECT3D to work with line objects is a little more tricky
: that patch or surface faces because line width and marker geometry
: is defined in pixel space, not data space. It can be done in m-code
: though, it's just more work.

: But I think your needs can be met if some basic assumptions
: are made. A simple algorithm would be to find the closest
: line vertex in 2-D view space relative to the selection point.
: This would ignore width properties, but it might just meet
: your needs.

: When I get a chance, I'll update SELECT3D on MATLAB Central
: for simple line object support.

: I should point out that full 3-D selection support is the MathWork's
: wish list, but I'm hoping SELECT3D will satisfy most needs in the
: mean time.

: Regradless, keep those enhancement requests coming.

: Joe Conti
: The MathWorks









--
Geoff

Subject: ginput for 3d plots?

From: Siamak

Date: 1 May, 2013 22:32:09

Message: 6 of 6

gegnal@gradient.cis.upenn.edu (Geoffrey Egnal) wrote in message <a4h1uu$h1o$1@netnews.upenn.edu>...
>
> Nevermind. I just saw the above response which has the answer.
>
> Thanks,
> Geoff
>
> Geoffrey Egnal (gegnal@gradient.cis.upenn.edu) wrote:
> : I'm trying to create a user interface where the user can select points
> : on a 3D plot. I'm having trouble using ginput.
>
> : Here's what I have:
>
> : %plot original points
> : plot3(pts(1,:), pts(2,:), pts(3,:),'bo');
> : camproj(gca,'perspective')
>
> : %figure out the 2d projection of these points
> : [az,el] = view;
> : T = viewmtx(az,el);
> : tmp = T*[pts;ones(1,size(pts,2))]
> : %skip the rescaling because the 4th row is already 1
>
> : So, here's the problem - none of the resulting 2d points look anything
> : like what I get from ginput(1) and selecting a point.
>
>
> : Can anyone help me? btw - I'm running 6.1 r12 on WinNT.
>
> : Thanks,
> : Geoff
>
> --
> Geoff


You can use datacursormode as well. check the examples provide in MATLAB help for datacursormode

Regards
Siamak

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us