Game Development Reference
In-Depth Information
Point light : This is the light from a point source such as a bulb.
Spotlight : This is similar to point light; however, it has a direction in which it
shines. A flashlight/torch is a perfect example of a spotlight.
Environment and materials
OpenGL uses materials to refer to the properties of an object that determine how it
interacts with light. In practice, when rendering you specify what (shape) to render
and how to render. The shape is specified using the Mesh (or more commonly
MeshPart ), which defines the vertex attributes for the shader. The material is most
commonly used to specify the uniform values for the shader.
Uniforms can be grouped into modelspecific (for example, the texture applied or
whether or not to use blending) and environmental uniforms (for example, the lights
being applied or an environment cubemap ). Likewise, the 3D API allows you to
specify a material and environment.
To find out more about materials, environments, and
attributes visit https://github.com/libgdx/libgdx/
wiki/Material-and-environment .
Basic 3D using LibGDX
Here, we will explore the basis of the LibGDX 3D API and will create a basic scene
with a sphere model at the center.
You can also check the LibGDX wiki on the 3D API at https://
github.com/libgdx/libgdx/wiki/Quick-start .
The project setup
First of all, let's create a new LibGDX project using gdx-setup-ui.jar as learned in
Chapter 1 , Introduction to LibGDX and Project Setup . Enter the values as shown here:
Name : ModelTest
Package : com.packtpub.libgdx.modeltest
Game Class : MyModelTest
Destination : C:\libgdx
 
Search WWH ::




Custom Search