[vtkusers] RE: Coordinates on a surface

James C. Robinson j.robinson at kepler-systems.com
Wed Aug 20 10:03:10 EDT 2003


Dean,

Thanks for the quick response. I have left out the 1.0 simply because at the
scale of interaction with the screen, 1 pixel/300 (approx height of vtk
window in pixels) effectively means a % error of position of order 0.3%.
There is obviously a definitive mapping, but at this stage I couldn't be
bothered.

I am surprised (and slightly peeved) that the mapping (y* = LWD - y) isn't
taken care of by the vtkPicker and I have yet to find the documentation that
explains this. The documentation for vtkPicker states:
virtual int vtkPicker::Pick 	( 	float 	  selectionX,
		float 	  selectionY,
		float 	  selectionZ,
		vtkRenderer * 	  renderer
	) 	[virtual]


  	Perform pick operation with selection point provided. Normally the first
two values for the selection point are x-y pixel coordinate, and the third
value is =0. Return non-zero if something was successfully picked.

Which is clearly stating that you give the x,y pixel coords. Everybody knows
that (at least of MS Windows) the origin is in the top left hand corner of
the window, so why not make it clear that it is now display coordinates!!??

Anyway, it isn't your problem, I am just venting (possibly misplaced)
frustration.

Many thanks again.

Regards,

Jim

______________________

James C. Robinson, PhD,
Chartered Engineer,
Kepler Simulation Systems Ltd.,
Unit 10,
Melbourne Business Park,
Model Farm Road,
Cork,
Eire

Tel:         +353-21-4822028
Tel:         +353-21-4817267
Tel:         +353-87-2393010
Fax:        +353-21-4822721
E-mail:     j.robinson at kepler-systems.com
______________________

-----Original Message-----
From: dean.inglis at camris.ca [mailto:dean.inglis at camris.ca]
Sent: 20 August 2003 13:49
To: j.robinson at kepler-systems.com
Subject: Re: Coordinates on a surface

James,

the one (could be + or - depending) may or may not be necessary depending on
whether the display coords are zero or 1 based, and whether the display
window height is given in terms of total pixels or
maximum pixel index.  I believe vtk interactors
handle this issue for you automatically whereas
in your code you are bypassing them.

Dean
>
> From: "James C. Robinson" <j.robinson at kepler-systems.com>
> Date: 2003/08/20 Wed AM 05:16:00 GMT-04:00
> To: <dean.inglis at camris.ca>
> Subject: Coordinates on a surface
>
>
> Dean,
>
> Many thanks for the ideas. I will set about implementing a change in my
> code. My guess is that the structures/objects that I have in place will
> work, but that the y coord was the problem. Where in the documentation
does
> it tell us that we have to transform the display coordinates in that
> manner???
>
> Regards,
>
> Jim
>
> PS: What is the "+1.0f" for? (adding a 1) - is the range of the screen 1 -
> DWH??
> ______________________
>
> James C. Robinson, PhD,
> Chartered Engineer,
> Kepler Simulation Systems Ltd.,
> Unit 10,
> Melbourne Business Park,
> Model Farm Road,
> Cork,
> Eire
>
> Tel:         +353-21-4822028
> Tel:         +353-21-4817267
> Tel:         +353-87-2393010
> Fax:        +353-21-4822721
> E-mail:     j.robinson at kepler-systems.com
> ______________________
>
>
>





More information about the vtkusers mailing list