Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
3d device coordinates from a 3D polyline....
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
george.millw...@yahoo.com  
View profile  
 More options Sep 28 2012, 5:30 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Fri, 28 Sep 2012 14:30:56 -0700 (PDT)
Local: Fri, Sep 28 2012 5:30 pm
Subject: 3d device coordinates from a 3D polyline....
Hi there,

This must be straightforward but I'm lost in the help system:

I have am idlgrpolyline which I can rotate in a 3D view (with the trackball).
I want to know the 2D coordinates of this line in the device (ie,the 2D the projection in the window).  Can't figure it out.

Any ideas ?

Cheers

George.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
george.millw...@yahoo.com  
View profile  
 More options Sep 28 2012, 5:31 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Fri, 28 Sep 2012 14:31:49 -0700 (PDT)
Local: Fri, Sep 28 2012 5:31 pm
Subject: Re: 3d device coordinates from a 3D polyline....

sorry, that should say : '2d device coordinates from a 3D polyline....'

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Oct 1 2012, 8:32 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Mon, 1 Oct 2012 06:31:59 -0600
Local: Mon, Oct 1 2012 8:31 am
Subject: Re: 3d device coordinates from a 3D polyline....

George.millw...@yahoo.com writes:
> I have am idlgrpolyline which I can rotate in a 3D view (with the trackball).
> I want to know the 2D coordinates of this line in the device (ie,the 2D the projection in the window).  Can't figure it out.

I'm no expert in this area, but I think the 3D to 2D
conversions of the transformation matrix (which you
can recover from the trackball) are well known. You
can read the answer at the bottom of this article,
for example:

   http://math.stackexchange.com/questions/336/why-are-3d-
transformation-matrices-4x4-instead-of-3x3

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
george.millw...@yahoo.com  
View profile  
 More options Oct 1 2012, 1:07 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Mon, 1 Oct 2012 10:07:21 -0700 (PDT)
Local: Mon, Oct 1 2012 1:07 pm
Subject: Re: 3d device coordinates from a 3D polyline....

Hmm,

So there is nothing in the object graphics system like the 'CONVERT_COORD' routine ?

George.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Coyote  
View profile  
 More options Oct 1 2012, 1:10 pm
Newsgroups: comp.lang.idl-pvwave
From: Coyote <sageande...@gmail.com>
Date: Mon, 1 Oct 2012 10:10:14 -0700 (PDT)
Local: Mon, Oct 1 2012 1:10 pm
Subject: Re: 3d device coordinates from a 3D polyline....

George Millward writes:
> So there is nothing in the object graphics system like the 'CONVERT_COORD' routine ?

Not to my knowledge. :-(

Cheers,

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alx  
View profile  
 More options Oct 2 2012, 5:22 am
Newsgroups: comp.lang.idl-pvwave
From: alx <lecacheux.al...@wanadoo.fr>
Date: Tue, 2 Oct 2012 02:22:12 -0700 (PDT)
Local: Tues, Oct 2 2012 5:22 am
Subject: Re: 3d device coordinates from a 3D polyline....
Le lundi 1 octobre 2012 19:07:22 UTC+2, (inconnu) a écrit :

In Object Graphics and New Graphics you can use "[XYZ]COORD_CONV" and
"ConvertCoord" methods, respectively. The last one being quite similar to the "Convert_Coord" function in Direct Graphics.
Alain.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
george.millw...@yahoo.com  
View profile  
 More options Oct 2 2012, 12:46 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Tue, 2 Oct 2012 09:46:16 -0700 (PDT)
Local: Tues, Oct 2 2012 12:46 pm
Subject: Re: 3d device coordinates from a 3D polyline....

Alain,

Thanks for your help.......I'm not using new graphics - this is all object graphics.  I've been trying to understand how [XYZ]COORD_CONV in object graphics relates to all of this - but it's somewhat confusing.
I understand how XCOORD_CONV and YCOORD_CONV are used to map a 2D line to 2D normalized space - but I'm wanting the same for 3D...

Cheers

George.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl  
View profile  
 More options Oct 2 2012, 5:02 pm
Newsgroups: comp.lang.idl-pvwave
From: Karl <Karl.W.Schu...@gmail.com>
Date: Tue, 2 Oct 2012 14:02:26 -0700 (PDT)
Local: Tues, Oct 2 2012 5:02 pm
Subject: Re: 3d device coordinates from a 3D polyline....

[XYZ]COORD_CONV is a PROPERTY, not a method, for many IDLGr* Object Graphics classes.  It is used to apply a transform to the raw vertex data stored in the object instance as the first part of the overall object-to-window transform that IDL performs when drawing the scene.

This is a simple scale and translate transform, so the values for all three ([XYZ]COORD_CONV) can be put into a 4x4 matrix and used to multiply all your 3D points stored in the object.

You'll also have to multiply the points by each 4x4 transform matrix stored in the TRANSFORM property in each IDLgrModel in your scene graph, working your way up to the view.

Then you need to apply a view transform using some of the properties (like VIEWPLANE_RECT) from the IDLgrView.  Finally apply a view-to-window transform to get your 2D device coordinates.

Figuring out the last two are perhaps the trickiest, especially if the view projection is perspective.  But it is possible.  

It should also be possible to write a general-purpose function that takes a "leaf" graphics object and walks up the scene graph, computing the single 4x4 combined matrix and returns it.  You would then use that single matrix to transform your points.

In a way, you are duplicating the entire transform that IDL applies to the points via the underlying graphics system (OpenGL).  I don't remember if there is a way to get this transform directly from IDL - don't think so.  And someone out there may have already written an IDL function to do this.  But, I don't know of any.

Karl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Galloy  
View profile  
 More options Oct 2 2012, 5:32 pm
Newsgroups: comp.lang.idl-pvwave
From: Michael Galloy <mgal...@gmail.com>
Date: Tue, 02 Oct 2012 15:32:01 -0600
Local: Tues, Oct 2 2012 5:32 pm
Subject: Re: 3d device coordinates from a 3D polyline....
On 10/2/12 3:02 PM, Karl wrote:

> It should also be possible to write a general-purpose function that
> takes a "leaf" graphics object and walks up the scene graph,
> computing the single 4x4 combined matrix and returns it.  You would
> then use that single matrix to transform your points.

> In a way, you are duplicating the entire transform that IDL applies
> to the points via the underlying graphics system (OpenGL).  I don't
> remember if there is a way to get this transform directly from IDL -
> don't think so.  And someone out there may have already written an
> IDL function to do this.  But, I don't know of any.

Isn't this the ::getCTM() method or am I misunderstanding the situation?

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Galloy  
View profile  
 More options Oct 3 2012, 10:49 am
Newsgroups: comp.lang.idl-pvwave
From: Michael Galloy <mgal...@gmail.com>
Date: Wed, 03 Oct 2012 08:49:05 -0600
Local: Wed, Oct 3 2012 10:49 am
Subject: Re: 3d device coordinates from a 3D polyline....
On 10/2/12 10:46 AM, George.millw...@yahoo.com wrote:

> Thanks for your help.......I'm not using new graphics - this is all
> object graphics.  I've been trying to understand how [XYZ]COORD_CONV
> in object graphics relates to all of this - but it's somewhat
> confusing. I understand how XCOORD_CONV and YCOORD_CONV are used to
> map a 2D line to 2D normalized space - but I'm wanting the same for
> 3D...

There are several examples of using [XYZ]COORD_CONV in the object
graphics chapter of my book, which also happens to be the sample chapter
that is freely available on the books website:

   http://modernidl.idldev.com

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl  
View profile  
 More options Oct 3 2012, 4:29 pm
Newsgroups: comp.lang.idl-pvwave
From: Karl <Karl.W.Schu...@gmail.com>
Date: Wed, 3 Oct 2012 13:29:01 -0700 (PDT)
Local: Wed, Oct 3 2012 4:29 pm
Subject: Re: 3d device coordinates from a 3D polyline....

yep, that's it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
george.millw...@yahoo.com  
View profile  
 More options Oct 4 2012, 12:23 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Thu, 4 Oct 2012 09:23:57 -0700 (PDT)
Local: Thurs, Oct 4 2012 12:23 pm
Subject: Re: 3d device coordinates from a 3D polyline....

Actually, this IS a 3D perspective view I'm working with.  I have a polyline in a 3D perspective scene.  One end of the polyline is at the center of my 3D coordinate system (ie, [0,0,0]) and the other end is at (say) [+10,0,0]. As I rotate it around with a trackball the 2D projection in the window can assume any
'size' (from a single pixel dot to a line of length 10) and any orientation (0 to 360 if you like).

I'm amazed there isn't an inbuilt function to tell me what these 2D window coordinates are - but there you go, nothing like spending a couple of weeks fiddling with IDL - it's fun right ?

I'll take a look a Michael's object graphics chapter.  For me that is the ideal sample chapter....

Cheers

George.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl  
View profile  
 More options Oct 4 2012, 4:16 pm
Newsgroups: comp.lang.idl-pvwave
From: Karl <Karl.W.Schu...@gmail.com>
Date: Thu, 4 Oct 2012 13:16:34 -0700 (PDT)
Local: Thurs, Oct 4 2012 4:16 pm
Subject: Re: 3d device coordinates from a 3D polyline....

It shouldn't take a couple of weeks.  As Michael pointed out, there is the GetCTM method that will give you the Current Transform Matrix for the given object.  You would multiply your desired 3D points by this matrix to (hopefully) get the window coordinates.  It should probably work for both ortho and perspective projections.

I just forgot about the GetCTM method.  That long description that I gave is probably pretty close to what GetCTM does under the covers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
george.millw...@yahoo.com  
View profile  
 More options Oct 4 2012, 4:21 pm
Newsgroups: comp.lang.idl-pvwave
From: George.millw...@yahoo.com
Date: Thu, 4 Oct 2012 13:21:24 -0700 (PDT)
Local: Thurs, Oct 4 2012 4:21 pm
Subject: Re: 3d device coordinates from a 3D polyline....

Karl,

Thanks for the suggestions.  I'll give getCTM() a go and report back what I come up with.  Yes, if getCTM is doing the job it should be 2 minutes , not 2 weeks.

Cheers for now,

George.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »