Hi Philip et al.
Your code looks like it should provide what I need! However I cannot find
the arglCameraView() function? - even if I include the gsub_lite.h library.
If I substitute in the argConvGlPara() function then it appears to work
successfully however my object is a long way in the distance, which suggests
that I need to use this new function so that I can scale the transformaion.
As far as I can tell I am using ARToolkit version 2.71.2 so according to the
API the function should exist..
Many thanks for your help!
Chris
________________________________________
From: Philip Lamb [mailto:phil@e ..........]
Sent: 18 June 2006 22:12
To: Chris Hughes
Cc: artoolkit@h ..................
Subject: Re: Converting the ARToolkit Matrix notation into VTK notation
On 19/06/2006, at 1:46 AM, Chris Hughes wrote:
I am looking to write a function to convert the ARToolkit Matrix into the
'eye position', 'look at point' and 'up vector' used in VTK. Has anyone got
any knowledge about how to do this? Or can you point me towards any
information about the ARToolkit Matrix in general?
Here's one way of doing it:
float scalef = 1.0f;
GLdouble m[16];
GLdouble eyepos[3], lookat[3], up[3];
// See detection loop in Idle() in simpleLite.c for context of the line
below.
arGetTransMat(&(marker_info[k]), patt_centre, patt_width, patt_trans);
// Make patt_trans into a standard OpenGL HCT matrix (N.B.:column-major).
arglCameraView(patt_trans, m, scalef);
// This treats the marker as lying in the x-y plane, with the +z axis
pointing towards the observer.
eyepos[0] = m[12]; eyepos[1] = m[13]; eyepos[2] = m[14];
lookat[0] = eyepos[0] - m[8]; lookat[1] = eyepos[1] - m[9]; lookat[2] =
eyepos[2] - m[10];
up[0] = m[4]; up[1] = m[5]; up[2] = m[6];
Cheers,
Phil.
--
Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi,
gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig
gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y
neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar
unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi,
rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a
gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i
hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn
Prifysgol Cymru, Bangor. Nid yw Prifysgol Cymru, Bangor yn gwarantu
bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu
100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn
nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract
rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa
Cyllid Prifysgol Cymru, Bangor. www.bangor.ac.uk (Ysgol Gwybodeg)
This email and any attachments may contain confidential material and
is solely for the use of the intended recipient(s). If you have
received this email in error, please notify the sender immediately
and delete this email. If you are not the intended recipient(s), you
must not use, retain or disclose any information contained in this
email. Any views or opinions are solely those of the sender and do
not necessarily represent those of the University of Wales, Bangor.
The University of Wales, Bangor does not guarantee that this email or
any attachments are free from viruses or 100% secure. Unless
expressly stated in the body of the text of the email, this email is
not intended to form a binding contract - a list of authorised
signatories is available from the University of Wales, Bangor Finance
Office. www.bangor.ac.uk (School of Informatics)
|