Creating a 3D Game With Three.js and WebGL

Prerequisites

  • A browser with WebGL – this game has been tested on Chrome and Firefox. IE still doesn’t support WebGL, unless you’re using Windows 8.1 with IE11.
  • Three.js library available for download from the Three.js website
  • The Keyboard.js helper library I used for this project, created by Arthur Schreiber at No Karma. Download it from my GitHub repository
  • A basic understanding of what Three.js does. Read this super simple, super quick tutorial by Paul Lewis. It’s basically a short-hand version of this article.

Setup

Get a base index.html running

Step one when making a web-based game is to create the host index.html file. In our case, it only needs to be a very simple set of elements, so we can bundle the CSS styling too.

Import Keyboard.js and Three.js

Three.js is a library contained in just one JavaScript file, so we can grab the minified version from the website.

For Keyboard input, we will need to referencethe aforementioned JavaScript file in our index.html as well.

Create setup() and draw() functions

The setup() function will be the start point for the game code. The draw() function will be run every frame and will handle all the rendering and game logic.

In order to loop the draw() function, we simply utilise the requestAnimationFrame() function call, and pass ‘draw’ as the parameter. Remember, not all browsers natively support the call, and you might have to use Paul Irish’s shim to gain maximum compatibility. Also, it is important to realise that requestAnimationFrame() does not guarantee a fixed frame-rate, so you need to use time-deltas to calculate realistic physics. For a basic game like Pong, we don’t really care about that.

Basic World

Set up the Three.js world and camera

Three.js includes these important elements:

  • Scene
  • Renderer
  • Camera
  • Mesh
  • Light
  • Material

Cameras, Meshes, and Lights need to be added to the scene using the scene.add() function.

Attach a WebGL Three.js Renderer to the DIV

The renderer is attached to whichever HTML DOM element you wish to render the scene to, and a render() call is made each frame to the renderer in order to draw the Three.js scene.

Add a camera to the scene

Three.js has the option to create Perspective and Orthographic cameras. For most uses, Perspective camera is the best choice. We can change position and rotation information of the camera like any other object in the scene.

Draw a sphere and light it

Meshes must be paired with Materials in order to give them a defined look and feel. Meshes can be of many types, include primitives such as Cube, Sphere, Plane and Torus. Materials can have different characteristics depending on their type. The basic Material types include Lambert, Phong, and Basic.

  • Basic renders an unlit Mesh with no shadows or dark shading. A sphere will look like a circle if rendered with Basic.
  • Lambert is a simple diffuse-like lighting that creates shading on sides facing away from a light source. It gives a basic 3D look of surfaces that are matte (non-shiny and non-reflective)
  • Phong is used for achieving a plastic-like look and feel, with the ability to gain highlights that give a much shinier appearance to the Mesh.

Show off your sphere with a Point Light. This is the most basic light, with no direction or rotation. Make sure you tweak the light’s intensity and distance to get it looking good.

Add Game Objects

Draw playing area plane

The playing area will be a Three.js

Google Play now Become the World’s Greatest Defeat Application Store App Store

Apple App Store now no longer be the world’s largest app store. Label the world’s largest app store is now officially carried by the Google Play Store that has 1 million applications.

The number also beat the applications now in the Apple App Store, which is 900 thousand units. This achievement was being the first time since the launch of Google Play Android operating system.

Not only that, Google Play Store is also giving a positive trend for the application developer. Google says that the current amount of revenue through the Play Store has increased 2.5-fold compared to the previous.

The last one, number download on Google Play Store also did not lose much. According to Google, the number of downloads in the Play Store has now reached more than 50 billion times. And it seems that number will continue to increase along with the increase of mobile phone users and Android tablets.

Predixion Software Raises $20 Million in Series C Financing

SAN JUAN CAPISTRANO, CA–(Marketwired – Jul 8, 2013) -Predixion Software, a developer of collaborative predictive analytics solutions, announced today it has raised $20 million in Series C financing. Predixion’s Series C includes two new strategic investors, Accenture (NYSE: ACN) and GE Ventures. Current investors DFJ Frontier, EMC, Miramar Venture Partners and Palomar Ventures also subscribed to the round of financing along with new investor, Frost Venture Partners.

In conjunction with its role in leading the financing round, Accenture will jointly develop a range of advanced analytics solutions for its clients with Predixion. These solutions will reduce the time and cost of decision making by extending the use of predictive analytics applications to managers in a range of business functions, allowing them to apply data-driven insights directly to their operational workflows. The solutions will be marketed to Accenture clients.

“We are pleased to join forces with Predixion Software to offer our clients’ business users new intuitive data analytics and collaboration solutions,” said Sajid Usman, global managing director for Technology at Accenture Analytics. “The end-to-end capabilities we’re building will make it more cost effective for our clients to turn data into insights, actions, and ultimately business outcomes. Our investment in Predixion is part of our ongoing strategy of bringing capabilities to our clients that cover the full analytics value chain and help them move forward on their Analytics Journey to ROI.”

Predixion provides collaborative predictive analytics solutions for customers across key industries such as healthcare, life sciences, financial services, marketing, government, manufacturing and ecommerce. Predixion software eliminates the complexity of predictive analytics so non-technical professionals on the front lines of business can anticipate customer needs, reduce costs and accelerate operational efficiency. For example, a healthcare administrator can predict which patients are likely to readmit, a bank manager can anticipate when a valuable customer is likely to switch banks, or a marketing manager can use predictive targeting to improve campaign response rates.

The company’s recent milestones include starting the year with six new strategic customers, revenue growth of over 800%, on average, for 2011 and 2012 as well as closing Q1 2013 revenue that exceeded all of 2012 revenue by 30%. Predixion was also selected as a finalist for Red Herring’s Top 100 North America award, a prestigious list honoring the year’s most promising private technology ventures from the North American business region.

“Bringing on world-class investors like Accenture and GE validates the massive opportunity for nimble predictive analytics technologies,” said Simon Arkell, CEO and Co-Founder, Predixion Software. “Partnering with such an experienced group of strategics will help us accelerate growth and scale globally as we continue our mission to drive adoption of predictive analytics into every industry.”

“From aviation to health care, GE’s customers are now collecting unprecedented amounts of data, due to a growing number of intelligent business systems and sensor-equipped machines,” said Brett May, Head of Software Ventures and Business Development, GE Software. “GE plans to launch many next-generation Industrial Internet services that leverage that data and its context. We believe that Predixion will broaden the spectrum of creators and consumers of big data predictive analytics and we’re excited about the company’s potential to help us offer data-driven value to our customers.”

Predixion will use the funding proceeds to accelerate product development and scale its sales and marketing organizations to support current and anticipated demand and growth for

Asphalt 8: Airborne Optimized for Tablet Nexus 7 Newest

The latest series flagship racing game Gameloft, Asphalt 8: Airbourne will present shortly, has been optimized with OpenGL ES 3.0 for the latest tablet Nexus 7. As exhibited at Google Keynote event yesterday in San Francisco.
Baudoin Corman as Vice President of Gameloft Publishing Section Regional Americans say, 8 Asphalt is an ideal game to demonstrate the greatness of Google’s latest device, the graphics are awesome and convenient physical form, the Nexus 7 will certainly help boost the popularity of gaming on tablets and realize the vision of Asphalt 8.
In addition to the new engine, Asphalt 8 will also bring 180 events, 47 official cars, and new game modes. There is also an online multiplayer mode with global leaderboard and social features like Facebook. Gamloft is arguably the first game publisher in the gaming service that supports Google Play. Asphalt 8 itself will be the first Gameloft game titles integrated Google services and Google Play at launch.

WhatsApp Luncurkan Fitur Baru di Windows Phone

Jakarta – WhatsApp is one of the instant messaging service that can be used by many types of cell phone operating system. Not surprisingly, WhatsApp has 250 million active users. According to the Wall Street Journal website, this amount is equivalent to the number of users on Twitter, Facebook Messenger, and Skype.
What’s more, the instant messaging application also does not include ads in their services. Users were not bothered by ads that sometimes appear like the other instant messaging services.
Now, WhatsApp update the application with new features for Windows Phone users. Some of the new features that include
1. Make voice calls;
2. Background API (Application Programming Interface) which can play music;
3. New Smiley;
4. Notifications are updated to the user;
5. Quick summary (if the application is open and the user clicks the notification, the application will open fast like on Android);
6. The user will be asked whether you want to save the conversation history, users can arrange it through the settings menu, and
7. Images are displayed larger.
Updates on Windows Phone devices can be downloaded in Windows Phone Store.