| ARToolKit | Mailing List Archive |
|
| From: | Stephen DiVerdi <sdiverdi@c ..........> | Received: | Jun 6, 2003 |
| To | Bruno <bruno@i .....> | ||
| Subject: | Re: patern position | ||
well, you specify the origin of the local coordinate space on the marker explicitly, with the center[] values. using (0,0) puts it in the center of the marker. if you want the position of the marker in global (camera) coordinates, it's easy to get - you just need to grab the translation vector out of the marker's transformation matrix. that's just the last column. as for fullscreen mode, you should be able to just call glutFullScreen (if you're using GLUT) after argInit, but i'm not positive. -steve diverdi -sdiverdi@c .......... > Hi, > > Can someone tell me where I can get the pattern center position > (coordinates)? I'd like to use this to calculate when too paterns are close > to each other. > > Other question: What do I need to change to artoolkit show the video in > full screen? > > Thanks, > Bruno Fernandes. > > |
|||
| From: | Bruno <bruno@i .....> | Received: | Jun 6, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | patern position | ||
Hi, Can someone tell me where I can get the pattern center position (coordinates)? I'd like to use this to calculate when too paterns are close to each other. Other question: What do I need to change to artoolkit show the video in full screen? Thanks, Bruno Fernandes. |
|||
| From: | "k.]I[an" <k.man@g .....> | Received: | Jun 6, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: patern position | ||
On Fri, 06 Jun 2003 16:49:05 +0100, Bruno <bruno@i .....> wrote:
> Hi,
>
> Can someone tell me where I can get the pattern center position
> (coordinates)? I'd like to use this to calculate when too paterns are
> close to each other.
>
> Other question: What do I need to change to artoolkit show the video in
> full screen?
>
> Thanks,
> Bruno Fernandes.
>
>
Hi!
You can use the object.trans[3][4]-matrix to get easy to the center of the
marker:
the fields [0][3], [1][3] and [2][3] are the tx, ty, tz translation-values,
which define the absolute position of your marker in your openGl-world.
to change ar-toolkit to fullscreen call your argInit() like this:
double zoom = 2.0; // to scale the video-image, e.g. a 320x240-captured
image would now result in a
// 640x480 glut-window
int b_fullScreen = 1; // boolean, 0 = windowed, 1 = fullscreen
argInit( &cparam, zoom, b_fullScreen, 0, 0, 0 );
// (the next three parameters are x,y-values and a flag for the use of an
head mounted display;
// don't bother)
greetings,
Toby.
--
- www.augmented.org -- www.footfighters.de -
- My life for Aiur... uh, I mean Ner'zhul! -
|
|||
| From: | Leif Oppermann <u13859@h .........> | Received: | Jun 6, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: patern position | ||
Bruno wrote:
> Other question: What do I need to change to artoolkit show the video
> in full screen?
I came up with the following to get a nice fullscreen support. The code
is based upon artoolkits simple example for windows.
greets,
leif
---
//*** top of your main
#include <winbase.h>
#include <wingdi.h> // devmode - for getting the device context
#include <winuser.h> // enumdisplaysettings
#define ARWIN_FULLSCREEN
//#define ARWIN_CHANGEDISPLAY // annoying while coding but usefull
for final versions
#define ARWIN_DISPLAYWIDTH 640
#define ARWIN_DISPLAYHEIGHT 480
//*** somewhere to your main source
BOOL ChangeScreenResolution (int width, int height, int bitsPerPixel)
// Change The Screen Resolution
{
DEVMODE dmScreenSettings;
// Device Mode
ZeroMemory (&dmScreenSettings, sizeof (DEVMODE));
// Make Sure Memory Is Cleared
dmScreenSettings.dmSize = sizeof (DEVMODE);
// Size Of The Devmode Structure
dmScreenSettings.dmPelsWidth = width;
// Select Screen Width
dmScreenSettings.dmPelsHeight = height;
// Select Screen Height
dmScreenSettings.dmBitsPerPel = bitsPerPixel;
// Select Bits Per Pixel
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH
| DM_PELSHEIGHT;
if (ChangeDisplaySettings (&dmScreenSettings, CDS_FULLSCREEN) !=
DISP_CHANGE_SUCCESSFUL)
{
return FALSE;
// Display Change Failed, Return False
}
return TRUE;
// Display Change Was Successful, Return True
}
//*** to main()
#ifdef ARWIN_CHANGEDISPLAY
ChangeScreenResolution(ARWIN_DISPLAYWIDTH, ARWIN_DISPLAYHEIGHT,32);
#endif
[..]
//start the main event loop
#ifdef ARWIN_FULLSCREEN
glutFullScreen();
#endif
atexit(cleanup);
argMainLoop( mouseEvent, keyEvent, mainLoop );
//*** to init()
DEVMODE currentDevmode;
[..]
/*glutGameModeString("800x600:16@6 .") ;
if (glutGameModeGet(GLUT_GAME_MODE_WIDTH) != -1) // if the width is
different to -1
{
argInit( &cparam, 2 , 0, 0, 0, 0 );
glutEnterGameMode() ; // enter full screen mode
}else*/
// open the graphics window (3rd parameter to 1 for fullscreen, very
buggy!)
// -> thus we use another way to make it fullscreen.
// get current screendimensions
if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, ¤tDevmode) )
{
// hardcoded for 320x240 cams, assuming that the display is
horizontally oriented (4:3)
#ifdef ARWIN_FULLSCREEN
#ifdef ARWIN_CHANGEDISPLAY
argInit( &cparam, ARWIN_DISPLAYWIDTH/(float)xsize , 0,
0, 0, 0 );
#else
argInit( &cparam,
currentDevmode.dmPelsWidth/(float)xsize , 0, 0, 0, 0 );
#endif
#else
// windowed mode, 75% width, 75% height of screen
argInit( &cparam,
currentDevmode.dmPelsWidth/(float)xsize/1.5 , 0, 0, 0, 0 );
#endif
}else{
// fullscreen not possible
argInit( &cparam, 2 , 0, 0, 0, 0 );
}
|
|||
| From: | Bruno <bruno@i .....> | Received: | Jun 9, 2003 |
| To | artoolkit@h .................. | ||
| Subject: | Re: patern position | ||
Hi, To test this, I had the program to write to me the values of object.trans [0][3], [1][3] and [2][3]. With a fixed camera and the pattern in a fixed position it gave me a value, then with everything in it's fixed position when I cover the marker with my hand and uncover it, the program gives me a new position value that is completely diferent from the other before. I repeat this and it aways give me a diferent position. Why this happens, shouldn't the position values be the same since the camera and the pattern didn't move? Thanks, Bruno. At 20:18 06-06-2003 +0200, you wrote: >On Fri, 06 Jun 2003 16:49:05 +0100, Bruno <bruno@i .....> wrote: > >>Hi, >> >>Can someone tell me where I can get the pattern center position >>(coordinates)? I'd like to use this to calculate when too paterns are >>close to each other. >> >>Other question: What do I need to change to artoolkit show the video in >>full screen? >> >>Thanks, >>Bruno Fernandes. >> > >Hi! > >You can use the object.trans[3][4]-matrix to get easy to the center of the >marker: >the fields [0][3], [1][3] and [2][3] are the tx, ty, tz >translation-values, which define the absolute position of your marker in >your openGl-world. > >to change ar-toolkit to fullscreen call your argInit() like this: > >double zoom = 2.0; // to scale the video-image, e.g. a 320x240-captured >image would now result in a > // 640x480 glut-window >int b_fullScreen = 1; // boolean, 0 = windowed, 1 = fullscreen > > argInit( &cparam, zoom, b_fullScreen, 0, 0, 0 ); > >// (the next three parameters are x,y-values and a flag for the use of an >head mounted display; >// don't bother) > > >greetings, >Toby. > > >-- >- www.augmented.org -- www.footfighters.de - >- My life for Aiur... uh, I mean Ner'zhul! - |
|||