A simple card game

In this blog post I will show you how to use real 3D perspective in a typical 2D card game. We will not look into the actual game logic, but only focus on the graphics side. Ranging from obtaining and preparing the assets up until using a perspective camera and positioning and rotating playing cards in 3D space. This is a relatively low entry tutorial, but some experience with libGDX is recommended.

more...

Pixels

A very common mistake when creating a (2D) game is to use (imaginary) pixels. Although it’s certainly understandable that some might find it easier to “think in pixels” when creating a 2D game, especially when learning, it is doomed to cause issues on the long run. In this little blog post I will show you why there are no pixels and why you probably shouldn’t use them.

more...


Using the libGDX 3D physics Bullet wrapper - part1

Many 3D games require some sort of collision detection between 3D objects. Sometimes it’s possible to do this with some basic math and bounding boxes and bounding spheres. But when shapes get more complicated, the math and code gets complicated as well. Luckily LibGDX comes with a wrapper around Bullet. Bullet is an open source 3D collision detection and phyisics library, making it possible to add collision detection with just a few lines of code. This tutorial will guide you in using the LibGDX 3D physics Bullet wrapper.

more...

Using collision shapes

Previously we’ve used a bounding box and bounding sphere to check whether or not an object is visible to the camera or touched and dragged. We’ve also seen that this can cause false positives. Sometimes you need a more precise method to check intersection. Collision shapes can be used to get a very accurate intersection check at almost no performance costs. They are also fundamental for collision detection and physics.

more...


3D frustum culling with libGDX

When rendering a 3D scene, the actual amount of visible objects is often a lot less than the total amount of objects within the scene. Rendering all object, even those that are not visible, can be a waste of precious GPU time and decrease the speed of the game. Ideally you’d want to render only those objects which are actually visible to the camera and ignore all other objects which for example are behind the camera. This is known as frustum culling and there are several ways to accomplish this. This tutorial will show you the very basics in how to accomplish frustum culling using the 3D api of LibGDX.

more...



Behind the 3D scenes - part2

In the first part of this tutorial we’ve seen the overall structure of the Model class of the LibGDX 3D API. In this second part we will look at the rendering pipeline, starting from loading the model, all the way up to actually rendering the model. We will not go in depth on each specific part of the rendering pipeline. We’ll just look at the very basics, which I think you should know when working with the 3D api.

more...

Behind the 3D scenes - part1

In the previous tutorial we’ve seen how to load a 3D scene using LibGDX. Now we’re going to take a quick look at what is actually going on behind the scenes. You don’t have to know this information to actually use the 3D api and if you don’t care how things work, you can safely ignore this. But I think it is good practice to know what is going on and how you can benefit from that. Therefor, this tutorial will cover the very basics, which I think you should know when working with the 3D api.

more...