Skip to content

dimaopen/tinyrenderer-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Renderer in Java

This project is a 3d model render which is based on the series of articles "Tiny renderer or how OpenGL works" by Dmitry V. Sokolov located here. Russian version of this articles is at Habr.

C++ version is here.

Build Requirements

  • Java 8
  • Maven 3.x

Runtime Requirements

  • Java 8

Download from Github

git clone https://github.com/dimaopen/tinyrenderer-java.git
cd tinyrenderer-java

Build

mvn clean package

Execute

java -jar tinyrenderer-1.0.0-SNAPSHOT.jar path/to/your/model.obj

As a single argument it takes a path to Wavefront .obj file. The model texture should be at the same directory named your_model_name_diffuse.tga. You can download some models from https://github.com/ssloy/tinyrenderer/tree/master/obj

To render a sample model just execute

mvn exec:java

The result picture is located at working_dir/result.png

Implementation

It's not ideal from performance perspective. I tried to code in an explicit way. Using Scanner instead of BufferedReader and StringTokenizer in model file parsing causes some performance penalty. Also the immutable Vectors require constant creating new Vectors instead of just changing primitive components.

About

Java implementation of tiny renderer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages