Giter VIP home page Giter VIP logo

Comments (26)

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

That's me. I used HMM as a 'drop-in' replacement for GLM, and in order to do any basic translations I had to transpose HMM's matrices to GL. More advanced use of matrices (projection, view, rotation) was completely unusable, causing the transformed points to fall outside of GL's frustum and be culled away. I can provide example source.

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

I think we might be inconsistent about row-major vs. column-major order right now (GLM is column-major.) I'm looking into it.

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

I mean i dont transpose any of my matrices and im fine, but if there is a issue we should fix it and have it so matrices do not need to be transposed, no reason for opengl to do that extra work

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

@StrangeZak What's your source for the perspective projection matrix? I don't have a linear algebra textbook handy and Google is being no help...

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

One second let me look i dont remember where i got it, but i can you reassure you it works.

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

Maybe these two videos:

https://www.youtube.com/watch?v=jeO_ytN_0kk
https://www.youtube.com/watch?v=dul0mui292Q

If you wanna check it that would be awesome.

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

@JesseRMeyer HMM_Translate is producing a row-major matrix instead of column-major (which OpenGL expects.) The rest of the functions seem to be producing column-major.

I hadn't run into this problem in my own project because I'm not yet using HMM_Translate. I'm starting work on a patch.

@StrangeZak Is your project using HMM_Translate at all? I'm surprised it would work for you...

(Also, this just highlights the need for #21!)

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

I think i might just use HMM_LookAt for the time being maybe thats why mine works, yeah we really need a Unit Test obviously. How has no body else hit this with so many people using it

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

There's like 25-30 people using this how is he the first to hit it. It makes no sense...

from handmademath.

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

I tried rendering again with the column/row fix, but it still doesn't work for me.

There's some relevent information in the pictures below.
http://imgur.com/a/ek2yM

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

Hmm. Could you maybe try a simpler case? Not sure which matrix might be the problem now.

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

That wireframe looks right for the most part, at least i think

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

Change your model matrix to:

hmm_mat4 ModelMatrix = HMM_Mat4d(1.0f);

And see what happens? @JesseRMeyer

from handmademath.

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

The wireframe is constructed by RenderDoc. You're supposed to see what you're rendering show up inside the bounds.

HMM_Mat4d(1.0f); didn't seem to do anything different. I'm relying on that being being an intrinsic part of the Translate function anyway.

Here's a gif of me 'building' up the final matrix. I'm out of time looking into this today, so I can either upload my project's source or after the weekend I can provide a simpler usage case.

The view matrix causes the camera to spin and flatten the object, but it shouldn't do either! I can't quite tell what the Projection matrix is doing. The values by that point in the transformation are too dorked to make an interpretation AFAIK.

http://imgur.com/elyx1Ux

from handmademath.

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

For reference it's supposed to look like this: http://imgur.com/Tqs8Ayb

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

Ill relook at this issue after my stream tomorrow maybe it will shed some light on this situation

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

Didnt mean to close this....

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

@JesseRMeyer There should be a new major version coming in the next few days where we will fix various bugs then we will try this again. Sorry for the hassle there might be a few bugs that i am not aware of

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

@JesseRMeyer Merged in a fix today, would be great if you could see if it fixes it for you. If not we will try again in a few days as there is a few bugs to squash

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

@JesseRMeyer We just merged a bunch more changes across the whole library (which is now thoroughly unit tested!) Give it another try and let us know how it goes. 😄

from handmademath.

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

Awesome work guys. I'll test this soon and will report back.

from handmademath.

JesseRMeyer avatar JesseRMeyer commented on May 22, 2024

You magnificent bastards! http://imgur.com/a/1rig0

This really did act as a drop in replacement! The only real difference so far is that HMM handles FOV slightly differently, so I had to change 45.0f to 90f for the perspective matrix. Very minor hurdle and obvious to track down. But you may want to make a mention of it for those wanting an absolutely easy transition. I'm also a little peeved that I have to capitalize all my vector components, but I'll get over that soon. :)

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

@bvisness Any idea what hes talking about for the FOV thing ?

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

@JesseRMeyer Glad everything is working now :)

from handmademath.

bvisness avatar bvisness commented on May 22, 2024

GLM probably requires you to put in half the desired FOV (45.0f for a 90.0f total FOV.) The function we're using just divides it in half before doing the math. No big deal, we're not doing anything wrong, just a difference in what the functions expect.

from handmademath.

StrangeZak avatar StrangeZak commented on May 22, 2024

@bvisness Awesome, i think we can finally close this issue 👍

from handmademath.

Related Issues (20)

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.