Kerosene
Proof of Concept : Virtual Reality WordPress
What would a basic WordPress look like in VR? Using the WordPress REST API, I could easily pull things like author information, post content, or even custom meta. Using WordPress gives a user friendly interface to control environment variables of a game. One example would be using custom meta to define something like the color of the world lighting. These sort of level variables could also be interesting for an application that allows user registration. Users could have their own levels or posts to show their content without knowing how to be a game dev. A travel blog comes to mind for this POC. Using 360 images as the post featured image, I wrapped them around the user with post content attached to UI elements.
After a two day hackathon the project was loading nicely. SimpleJSON proved to be an interesting library to dissect, but I was able to get JSON objects accessible via C#. In the controllerWordPress scripts (Assets/Scripts/) you'll find the bulk of how to accomplish this. I'll document the code further as I work on this. 🙂
Made a VR #WordPress in #unity3d using the WP REST api. toggle posts with the controller. Feat. Image gets attached to skybox. 👽#vrdev #vr pic.twitter.com/ictJpERAN5
— antpb (@antpb) September 14, 2017
What is happening for each post?
- We make a REST call for most recent post with a limit of one and an offset defined as zero.
- From there we take the featured image from the post and attach it to a sphere surrounding the user.
- After loading the post data it queries the comment and author information. It does a call for each (this needs major refinment.)
- The author data then pulls the gravatar, and description of the author. These assets are attached them to the left plane. Post comments go to the right plane.
- On Vive button press it adds one to the offset and repeats all the calls above.
Download:
Github: https://github.com/anthonyburchell/VR-WordPress
The readme in the repo should cover basic usage.