22. April 2015

 

The following is a companion post containing the hotkeys used in the following video.  It is an hour in duration and attempts to teach the basics of 3D modeling in Blender.  It is a companion to this video which is also an hour in duration and introduces the viewer to Blender.  Of course if you prefer text based tutorials, we’ve got you covered there too!

 

The Video

 

The HotKeys

 

Blender Hotkeys

Action

 Hotkey

Switch mode ( object, edit ) Tab
Switch Edit Mode (Vertex, Edge, Face) Ctrl + Tab
Switch to Edit Vertex Mode Ctrl + Tab + 1
Switch to Edit Edge Mode Ctrl + Tab + 2
Switch to Edit Face Mode Ctrl + Tab + 3
   
Rotate R
Scale S
Translate/Move/Grab G
   
Select Object RMB
Select Multiple Shift + RMB
Select All/Clear Selected A
Select Edge Loop Alt + RMB
Box select B
Circle Select C
Lasso Select Ctrl + RMB
   
X Ray Display Mode Z
   
Specials Menu (Common operations) W
Vertex Menu Ctrl + V
Edge Menu Ctrl + E
Face Menu Ctrl + F
   
Extrude E
Bevel Ctrl + B
Knife Tool K
Connect Vertex J
Fill/Create Face F
Insert Edge Loop Ctrl + R

Art , ,

8. April 2015

 

The first tutorial in the Unreal Engine vs Unity tutorial series is now live.  In this tutorial we look at using Unreal Engine.  It’s an introduction to Unreal Engine, a guided tour around the editor, then we create a simple Hello World application using Blueprints.

 

I will be creating a companion text tutorial to go along with this video shortly.

 

You can see the video in full 1080p here.

 

The Video

 

Programming , , ,

7. April 2015

 

In this video tutorial we continue to look at 3D programming in LibGDX.  First we look at how to convert a 3D model to work with LibGDX using fbx-conv.  We then write the code to display that model and look at displaying animations.  The fbx-conv application can be downloaded here.

 

The data file used in this example can be downloaded here (zip format).  If you are interested in learning more about the process of creating the model click here.

 

The video is available in HD here.

 

The source code, and an embedded copy of the video, are available below.

 

 

Source Code

 

package com.gamefromscratch;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.graphics.g3d.Environment;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.gdx.graphics.g3d.ModelBatch;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.loader.G3dModelLoader;
import com.badlogic.gdx.graphics.g3d.utils.AnimationController;
import com.badlogic.gdx.utils.UBJsonReader;

public class ModelTest extends ApplicationAdapter {
    private PerspectiveCamera camera;
    private ModelBatch modelBatch;
    private Model model;
    private ModelInstance modelInstance;
    private Environment environment;
    private AnimationController controller;

    @Override
    public void create() {
        camera = new PerspectiveCamera(75,Gdx.graphics.getWidth(),Gdx.graphics.getHeight());

        camera.position.set(0f,100f,100f);
        camera.lookAt(0f,100f,0f);

        camera.near = 0.1f;
        camera.far = 300.0f;

        modelBatch = new ModelBatch();

        UBJsonReader jsonReader = new UBJsonReader();

        G3dModelLoader modelLoader = new G3dModelLoader(jsonReader);
        model = modelLoader.loadModel(Gdx.files.getFileHandle("model.g3db", Files.FileType.Internal));
        modelInstance = new ModelInstance(model);

        environment = new Environment();
        environment.set(new ColorAttribute(ColorAttribute.AmbientLight,0.8f,0.8f,0.8f,1.0f));

        controller = new AnimationController(modelInstance);
        controller.setAnimation("Mixamo.com", -1, new AnimationController.AnimationListener() {
            @Override
            public void onEnd(AnimationController.AnimationDesc animation) {
            }

            @Override
            public void onLoop(AnimationController.AnimationDesc animation) {
                Gdx.app.log("INFO","Animation Ended");
            }
        });
    }

    @Override
    public void dispose() {
        modelBatch.dispose();
        model.dispose();
    }

    @Override
    public void render() {
        Gdx.gl.glViewport(0,0,Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
        Gdx.gl.glClearColor(1,1,1,1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT|GL20.GL_DEPTH_BUFFER_BIT);

        camera.update();
        controller.update(Gdx.graphics.getDeltaTime());

        modelBatch.begin(camera);
        modelBatch.render(modelInstance);
        modelBatch.end();
    }
}

 

Video

 

Programming , , ,

26. March 2015

 

I just started a new concept off today, please let me know if you like it.  Basically it’s a fixed duration (one hour) overview on a specific topic, in this case Blender.  The idea is to give a cross between an introduction and a tutorial on getting started with using a certain product.  In this video we look at Blender, how to configure it, how to navigate and customize the interface, what it’s composed off and the basics of operating it.

 

If there is interest, I can do “An hour with” topics that are much more focused, such as “An hour Modelling” or “An hour texturing”, etc.

 

Additionally, this is not a deep dive Blender tutorial.  Fortunately I already have one of those!  If you are looking at specifics of learning Blender, the hotkeys, etc, please start here.

 

Below is an embedded version of the video.  It is also available in full 1080p on YouTube here.

 

The Video

 

Art , ,

24. March 2015

 

In this tutorial we start looking at 3D game development using LibGDX.  We explore creating a Camera, Model, ModelInstance and look at the basics of working in 3D using LibGDX.

 

You can watch the tutorial in HD here or embedded below.  The following is the source used in this example.

 

The Source


package com.gamefromscratch;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g3d.*;
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.math.Vector3;

public class Demo3D extends ApplicationAdapter implements InputProcessor {
    private PerspectiveCamera camera;
    private ModelBatch modelBatch;
    private ModelBuilder modelBuilder;
    private Model box;
    private ModelInstance modelInstance;
    private Environment environment;
   
   @Override
   public void create () {
        camera = new PerspectiveCamera(75,Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
        camera.position.set(0f, 0f, 3f);
        camera.lookAt(0f,0f,0f);
        camera.near =0.1f;
        camera.far = 300f;

        modelBatch = new ModelBatch();
        modelBuilder = new ModelBuilder();
        box = modelBuilder.createBox(2f,2f,2f,
                new Material(ColorAttribute.createDiffuse(Color.BLUE)),
                VertexAttributes.Usage.Position|VertexAttributes.Usage.Normal);
        modelInstance = new ModelInstance(box,0,0,0);
        environment = new Environment();
        environment.set(new ColorAttribute(ColorAttribute.AmbientLight,0.8f,0.8f,0.8f,1f));

        Gdx.input.setInputProcessor(this);
   }

   @Override
   public void render () {
      Gdx.gl.glClearColor(0, 0, 0, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT|GL20.GL_DEPTH_BUFFER_BIT);

        camera.update();
        modelBatch.begin(camera);
        modelBatch.render(modelInstance,environment);
        modelBatch.end();
   }

    @Override
    public boolean keyDown(int keycode) {
        // In the real world, do not create NEW variables over and over, create
        // a temporary static member instead
        if(keycode == Input.Keys.LEFT)
            camera.rotateAround(new Vector3(0f, 0f, 0f), new Vector3(0f, 1f, 0f), 1f);
        if(keycode == Input.Keys.RIGHT)
            camera.rotateAround(new Vector3(0f,0f,0f),new Vector3(0f,1f,0f), -1f);
        return true;
    }

    @Override
    public boolean keyUp(int keycode) {
        return false;
    }

    @Override
    public boolean keyTyped(char character) {
        return false;
    }

    @Override
    public boolean touchDown(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchUp(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchDragged(int screenX, int screenY, int pointer) {
        return false;
    }

    @Override
    public boolean mouseMoved(int screenX, int screenY) {
        return false;
    }

    @Override
    public boolean scrolled(int amount) {
        return false;
    }
}

 

The Video


Programming , , ,

Month List

DisqusCommentsSummary