Skip to content

A ray tracer written in lua for the Ti Nspire CX - II

Notifications You must be signed in to change notification settings

hsradA23/calcRayTracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

calcRayTracer

A ray tracer written in lua for the Ti Nspire CX - II

The Engine

The scene has to be edited by changing the source code. The default example has 2 spheres placed on a plane, illuminated by a point source of light above them.

the objects global variable contains a list of all the objects present in the scene. Each object has its own properties, described in the beginning of each class decleration.

The program checks whether it is being run on a calculator by checking the platform environment variable. If it is on the calculator, the output is painted on the display, otherwise a bitmap image called p6.bpm is saved in the current working directory.

The b2m.lua file is used from rosettacode.org and is only used to check the the image generated on a computer, it is only used for debugging.

Shapes

The following shapes are supported by the renderer:

  • 2D Plane
  • Sphere

Colours

The colours are stored as vectors, as it was necessary to save on the little memory that we have on the calculator. instead of the object being interpreted as {x,y,z} for coordinated, it is interpreted as {R,G,B} for colour values.

About

A ray tracer written in lua for the Ti Nspire CX - II

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages