Virtual Reality Experiment

Posted by mimetic, Posted on December 18, 2011

1 vote
GitHub URL: 
https://github.com/mimetic/CoronaVR

An experiment to show a virtual reality still image using Corona SDK. In theory, this could be an animation, too... feel free!

The app senses the physical attitude of the device using the gyroscope. As you turn the device, the image moves, as though you were turning your head. You can spin in a chair and see the world around you.

It seems to freeze in the vertical some times. Quit the app, shut it down, and it seems to come back.

This code uses Ultimote so the simulator will show the device activity. Here's Ultimote:
http://developer.anscamobile.com/forum/2011/11/13/corona®-ultimote

I believe it will work by commenting out these lines, if you don't have Ultimote:

local ultimote = require("Ultimote")
ultimote.connect()

The biggest problem at the beginning is that Corona SDK doesn't read pitch/yaw/roll, but uses the change in the gyroscope. The gyro drifts a lot, so this is not very stable. Hopefully, they will give us access to the other values, too.


Replies

nicholas.windsor's picture
nicholas.windsor
User offline. Last seen 1 week 2 days ago. Offline
Joined: 6 Apr 2011

Hi,

Looking forward to trying this, but I think your link to Github includes your log-in username for Github so it didn't link through for me.

Thanks

Nick

lemsim
User offline. Last seen 4 weeks 1 day ago. Offline
Joined: 30 Mar 2011

Great job! I could see a lot of games could you these feature. I need to study the code but it really work great (iphone4) and VERY fast! I wonder how it would react if we add game objects over the image that scrolling around. I need to do some tests.

Thanks for sharing.

Mo

Ninja Pig Studios's picture
Ninja Pig Studios
User offline. Last seen 15 hours 54 min ago. Offline
Joined: 26 Jan 2011

When I put this on my phone, the X Y and Z coordinates stay constantly at 0, almost like the virtual reality isn't working. Any thoughts?

Regards,
Jordan Schuetz
Ninja Pig Studios

lemsim
User offline. Last seen 4 weeks 1 day ago. Offline
Joined: 30 Mar 2011

Hi,

Is this on an Android? In my iphone4, it works great. The Y (up/down) is a little strange sometimes but X works great and FAST!

Its been a while since i tested it but if I recall you need to comment out the the lines about the accelerometer data coming from the Ultimote soft if you do not have it.

Hope this helps.

Mo

mimetic's picture
mimetic
User offline. Last seen 1 week 3 days ago. Offline
Joined: 12 Feb 2011

I have update the code to demonstrate:

- Swiping in addition to using the gyroscope. Tap to disable gyro and enable swiping to scroll the image; tap again to enable the gyro.

- I have added a hotspot, a button, to demonstrate that it can be easily done.