Giter VIP home page Giter VIP logo

minirt_42's Introduction

Hi there!

My name is Rodrigo Alves!

GitHub Streak

       Top Langs


You can find me on :


minirt_42's People

Contributors

araggohnxd avatar rodrigo-br avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

araggohnxd

minirt_42's Issues

Segmentation fault when inversing matrices with determinant equal to zero

What is wrong

In the current state of the code, if you happen to try to inverse a matrix which has its determinant value equal to zero, the inverse_matrix function will return NULL, which can cause a segmentation fault when solving the program's equations.

How to reproduce:

t_object    *object = create_sphere();

set_object_transformation(object, shearing_matrix((t_shearing){1, 1, 1, 1, 1, 1}));

Setting this shearing transformation to object will return NULL to its object->inverse_transformation property. When this property is used in an operation, per se, in ray transformation, it will segfault.

How to fix:

We can either

  1. return an identity matrix if we find an zero-determinant matrix while trying to inverse it, or we can
  2. make so that our main data structure is a singleton, so whenever we find a flaw in our transformations, we can call that singleton and clear its memory, exiting the program gracefully.

Parser.c need a fix on conditionals

parser.c don't protect cases where L, C or A are wrong:
Example: Cava, Linho will be read as Camera and Light.
Solution: the use of ft_strcmp and change typedef to "L" instead 'L'

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.