ARToolKit | Mailing List Archive |
![]() |
From: | Fernando Giovanini <giovanini@u ............> | Received: | Jan 26, 2007 |
To | ARToolkit <artoolkit@h ..................> | ||
Subject: | Moving an object | ||
Hi, all. I need to move an object (a sphere), but i'm trying to change the patt_trans value and it is not working. While i'm pressing the keyboard button, the sphere moves, but when I release it, the sphere "go back" to the marker. What can I do to make my sphere move and stay on the position? Thank you, Fernando. |
From: | Daniel Wagner <daniel@i ...............> | Received: | Jan 26, 2007 |
To | ARToolkit <artoolkit@h ..................> | ||
Subject: | Re: Moving an object | ||
hi Fernando, I doubt anybody will be able to really help you with that problem description. What kind of program is that you are talking about? Is it a sample? A modified sample? Your own code? >From what you are writing I guess you are talking about custom code you wrote. It seems that you update (overwrite) the patt_trans value as long as you hold down that key. Since patt_trans is updated every frame your object will jump back as soon as you release the key and don't overwrite patt_trans anymore. To make the sphere stay where it is you would have to add the offset (initialized with <0 0 0> every frame (independent of key strokes) and only modify that offset with the keys. This is quite trivial to do but maybe I completely misunderstood your problem... bye, Daniel |
From: | "Bruno Fernandes" <brunofer@g ......> | Received: | Jan 26, 2007 |
To | artoolkit@h .................. | ||
Subject: | Re: Moving an object | ||
Hi Fernando, Try using the functions glTranslatef() and glRotatef(). Apply them just before the arVrmlDraw() call in the Display function. This probably works for non vrml examples too, although i didn't test. Abraço, Bruno. -------- Original-Nachricht -------- Datum: Fri, 26 Jan 2007 16:23:54 -0300 Von: Fernando Giovanini <giovanini@u ............> An: ARToolkit <artoolkit@h ..................> Betreff: Moving an object > Hi, all. > I need to move an object (a sphere), but i'm trying to change the > patt_trans value and it is not working. While i'm pressing the keyboard > button, the sphere moves, but when I release it, the sphere "go back" to > the marker. What can I do to make my sphere move and stay on the position? > > Thank you, > Fernando. -- "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail |