Coder Social home page Coder Social logo

Comments (3)

simonech avatar simonech commented on July 17, 2024

from ray-tracer-challenge-netcore.

y2k4life avatar y2k4life commented on July 17, 2024

Not too many spoilers, mainly chapter 1 stuff, but I did not realize the impact until later chapters.

I have been lucky so far without having other “real life” stuff impact my progress but that will all start to change in a couple of days.

from ray-tracer-challenge-netcore.

hakanai avatar hakanai commented on July 17, 2024

I'm having a similar struggle over in my Kotlin version. I initially implemented all three as just Tuple.

Then once I wanted more implementations of color than what a tuple could store, I had to extract Color as its own thing so that it could have multiple implementations down the track.

Now I'm trying to do the same for Point and Vector but those are significantly harder. In a local branch I have deleted my Tuple class completely and have just implemented Point and Vector separately, which isn't too much duplication anyway, like you say. The hardest thing is massaging the test suite to separate the two concepts.

And yes the W value broke me at some point too, I think it was in the Matrix * Vector part, where the W value is just reset to zero after doing the transform. In my case I've resolved it by dropping the matrix to a 3x3 before doing the multiply, which probably saves a bunch of operations anyway. Another benefit of having separated the Vector and Point classes I guess?

What I'm wondering now is how much I would regret things if I also removed W for points. If it always has to be 1.0 anyway, why store it?

from ray-tracer-challenge-netcore.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.