keithstellyes

keithstellyes

The Ray Tracer Challenge: Getting rotationX matrix test to pass [SOLVED]

EDIT: I misread the scientific notation, I was getting, “-4.37114e-08”, turns out that’s almost 0. GTest’s ASSERT_FLOAT_EQ is super conservative by default haha. I’m good. Thanks for such a great book :slight_smile:
@jamis

I bought the book some years ago and did through a lot of it, but wanted to revisit it from scratch again, as a more experienced programmer.

However, for the test of multiplying a rotation X matrix of pi/2 radians by a Point(0, 0, 1), it fails generating a point where the y component is ~-4.4. Interestingly, the test after for multiplying the inverse(rotation_x(pi/4)), my code passes that test.

I’m hoping to work on my math skills, but I’m not sure exactly where I should be focusing my debugging efforts, or what tests to catch potentially if theere’s some other issues with dependent code that I missed.

Thanks again for a great book

First Post!

jamis

jamis

Author of Mazes for Programmers and 1 other title

I’m so glad you figured it out! Thanks for trying the book. It was a lot of fun to write. :slight_smile:

Where Next?

Popular Pragmatic Bookshelf topics Top

Alexandr
Hi everyone! There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
New

Sub Categories: