Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Head Tracking for VR.

Author
Message
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Jun 2014 16:05
Hi all,
I've been looking at creating some 3d camera controls that track the movement of the phone so when strapped to your head in something like a Durovis Dive, you get the full head-tracking VR experience.
Using the latest V1 AppGameKit, I've been having a lot of trouble getting the correct angles from the limited range of accelerometer commands available. GetRawAccelX, Y, and Z don't appear to work as I'd expect (i.e. getrawaccelx should give the angle of tilt towards or away from the user - rotation along the x axis - but it doesn't, at least on my Galaxy S2 it doesn't). If anyone has achieved this in AppGameKit, I'd love to know how you managed it!
Thanks

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Jun 2014 17:23 Edited at: 16th Jun 2014 17:24
i think u must mount the handy away from any x,y,z center axis
means any head movement will result in a acceleration.
the 3d camera control is relative.

the idea of head-tracking with phone is nice
useful for air plane simulations fsx / x-plane.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 16th Jun 2014 18:03
Just found some formulas for translating those raw values. hopefully they'll do the trick! (can't test until tonight when I get home). But here they are:

Roll = atan2(Y, Z) * 180/M_PI;
Pitch = atan2(X, sqrt(Y*Y + Z*Z)) * 180/M_PI;

Need to find one for Yaw...

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Jun 2014 19:02 Edited at: 16th Jun 2014 19:04
its one of this?
x,y
x,z

y,x
y,z

z,x
z,y

180/M_PI looks atan2 in c returns angle in radian measure.
agk have both, without "Rad" its returns degree.
ATan2 ( y, x )
ATan2Rad ( y, x )
ATanFull ( x, y )
ATanFullRad ( x, y )

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Jun 2014 02:16 Edited at: 17th Jun 2014 02:19
So after having played with ATan2 (which works perfectly!) I have realised that I can't get a Yaw value from the accelerometers alone Unless someone can prove otherwise (please!).

Pitch and roll works great, but without yaw my project cannot fly.

I think I need to be able to read gyroscope. The GetRawGyroVelocityX/Y/Z don't appear to work at all.

Here's a little example for pitch and roll:


If we can get yaw working too, then fully immersive VR and Augmented Reality applications in AppGameKit will be a reality!

p.s. How do I get my V2 backer badge?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jun 2014 02:37 Edited at: 17th Jun 2014 03:58
AGK Product Chat / AppGameKit V2 Backer Badges!
http://forum.thegamecreators.com/?m=forum_view&t=206481&b=41

edit:
hmm, i tryed some test but no success.
also i wonder why accelerometer commands show me z=1 without acceleration.
seems accelerometer commands is similar a up vector, means 1 axis.
the problem with yaw rotation is, if you turn 1 axis its still the same vector (in x,y,z direction)

the solution whould be a (working) compass command.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Jun 2014 15:28 Edited at: 17th Jun 2014 15:36
I think the gyro commands would work better as they can measure changes in gyro speed through all three axis. I wonder if they are complete in AGKv2 (the latest update does say that all existing language features are now complete!). I'll do some more experimenting tonight. If it comes to it, I'll try and add some Gyro compatibility via jni or maybe native t2 if I can't find anything to do the job with the built-in commands.

Even with just tilt and roll, the AR effect is really cool. I'll add some smoothing to the movement tonight and put a proper demo together.

Has no-one else tried doing AR with AppGameKit yet? I'm surprised.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jun 2014 16:10 Edited at: 17th Jun 2014 16:11
i guess u use a handy and multiplayer commands and pc agk app with 3d scene, true? or u bring the phone in front of eyes?

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Jun 2014 16:59
The plan is to bring the phone in front of eyes with a type of modern perfecscope such as: Durovis Dive (www.Durovis.com), vrAse (www.Vrase.com) or Vrizzmo (www.dejetworks.com) etc.

Each of these headset makers appear to be releasing SDKs for various game development platforms and I think it would be fantastic to get AppGameKit involved in such a cool new tech!

Paul >> Any chance you could get the gyro commands finished in V1? In an ideal world, I would like to see getgyropitch getgyroroll and getgyroyaw commands

Oh... and bluetooth support for a handheld game controller like a PS3 SixAxis. Pushing my luck I know! lol. - But the multiplayer commands / pc app will do the job for now. (Good idea Markus! Thanks!)

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jun 2014 17:31 Edited at: 17th Jun 2014 17:39
hmm, it seems it just render a 3d scene twice for left and right eye
of a half handy screen.

at home i have a 3d monitor, its very cool for games RPG or pinball.
but eye glasses for 3d would be much better.

some new eye glasses using a "laser" and not lenses.
with laser technique u can see also normal + overlay,
means u can project a car repair help for non-professional.
or u car drive bike and show overlay navigation etc.
laser technique have no eye focus problem.

vrAse looks interesting, i want test it anytime.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265

Login to post a reply

Server time is: 2024-11-25 06:57:16
Your offset time is: 2024-11-25 06:57:16