Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ginput for 3d plots?

402 views
Skip to first unread message

Geoffrey Egnal

unread,
Feb 14, 2002, 2:02:41 PM2/14/02
to
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

Geoffrey Egnal

unread,
Feb 14, 2002, 2:08:14 PM2/14/02
to

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

Thanks,
Geoff

Geoffrey Egnal (geg...@gradient.cis.upenn.edu) wrote:
: I'm trying to create a user interface where the user can select points

: Thanks,
: Geoff

--
Geoff

Geoffrey Egnal

unread,
Feb 14, 2002, 2:36:25 PM2/14/02
to
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?

Joe Conti

unread,
Feb 14, 2002, 4:26:30 PM2/14/02
to
geg...@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


Geoffrey Egnal

unread,
Feb 15, 2002, 10:38:13 AM2/15/02
to

Perfect! Thanks for the fast reply.

Geoff


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

: Geoff:

: Joe Conti
: The MathWorks

--
Geoff

Siamak

unread,
May 1, 2013, 6:32:09 PM5/1/13
to
geg...@gradient.cis.upenn.edu (Geoffrey Egnal) wrote in message <a4h1uu$h1o$1...@netnews.upenn.edu>...
You can use datacursormode as well. check the examples provide in MATLAB help for datacursormode

Regards
Siamak
0 new messages