Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

3D Engine in Java

This is a very small engine written in plain java which renders 3D scenes. The math behind is very simple - without any matrix transformations. Just trigonometric solutions

Features

  • Perspective projection
  • FOV
  • Rotation/Translation for the entire scene/camera
  • Triangle/Line Clipping
  • New 3D Depth algorithm - Modified Painter's algo - now using a dependency graph which is topologically sorted and which generates a perfect result
  • Right click to select the visible triangle
  • New Added light effects
  • New Added culling filter and improved speed
  • New Added shading. This can be disabled. Now shading works on clipped triangles as well

Objects file format

The engine supports vertexes, normals and faces defined in standard .obj files. Standard here.

However other objects can be defined in .txt files, following another standard. The format is at it follows:

  • Any empty line is ignored
  • Any line starting with / is ignored
  • Every valid text line describes a triangle followed optionally by the color or by the debug name
    • The debug name is given to the triangle on the same line
    • Can only be given if a color is already specified a.k.a there cannot be a triangle with a debug name but not a color
  • Every line consists of three blocks separated by empty spaces and representing individual point coordinates for the corner of triangle
    • x1,y1,z1 <space> x2,y2,z2 <space> x3,y3,z3 <space> <color> <debug_name>
  • Color format is in RGB values separated by comma:
    • r,g,b

Known Issues

  • Depth ordering inaccuracies when the triangles are intersecting or loop
  • Slow

Rendering Examples

image image image image image

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages