Book Image

WebGL HOTSHOT

By : Mitch Williams
Book Image

WebGL HOTSHOT

By: Mitch Williams

Overview of this book

Table of Contents (17 chapters)
WebGL HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building a navigable world of Facebook friends


The previous example programmed some pretty critical fundamentals of grabbing multiple Facebook images and pasting them into a 3D environment. We have yet to exploit the capabilities of interactive 3D worlds. Now, we shall add the ability to walk through our 3D Facebook world using the arrow keys and the mouse to navigate through Facebook pages. From here, we will use our imagination to create what a 3D social media world can become.

Engage thrusters

We continue to retrieve images using the facebook3dUI() function as in the previous example, but now we also call a new facebookFriendsNames() function that returns our friends' name and a link to their Facebook page and saves them in the facebookName and facebookLink arrays. The key coding change is in the data we request from the Facebook API, FB.api('/me/friends?fields=name,link…), which tells Facebook to return the names and web addresses of our friends. Note that we are hardly limited by just...