fabricecastel / scala-raytracer Goto Github PK
View Code? Open in Web Editor NEWA minimal raytracing rendering engine built in Scala
A minimal raytracing rendering engine built in Scala
The javax code does some pretty nasty stuff like:
v1.cross(v2, v3)
will set the v1 vector's value to be the result of v2 cross v3. Would be better to have a method defined in the Vector3D wrapper method that takes in a Vector3D and returns a new Vector3D rather than this mutation bullshit.
the wrapper is vecmath.scala
Requires the polynomial solver to be implemented beforehand
Used to be in Lua, could be just about anything - I'm not picky
Do a second pass after the initial aliased render and average N squared new rays per pixel whose colour value differs from its neighbours beyond an adjustable threshold
To run tests, use the "sbt test" command. There's a sample test suite under src>main>test>scala>TriangleSpec.scala for reference
A quick google search turned this up: http://stackoverflow.com/questions/14094042/calculating-camera-ray-direction-to-3d-world-pixel
May or may not be enough to implement this.
Seems to do the job. Haven't tested it much. Would be nice for it not to look like such a mess though.
For now, we only need to be able to solve roots for polynomials of degree 2, though if we can also have higher degrees as a freebie I can't see why we shouldn't do it.
Implement a new Polysolver class for this purpose with a simple solve(a: Int, b: Int, c: Int) API that returns a List[Int] and disregards complex solutions
maybe a bit overkill, but should have all the relevant info
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.