https://linen.dev logo
Join Discord
Powered by
# lime
  • h

    hallowed-ocean-84954

    05/08/2023, 5:59 PM
    so actually you probably just don't need the Matrix4 here at all - you could just use the array.
  • t

    tall-teacher-57409

    05/08/2023, 6:01 PM
    idk but Matrix4 looks like it has a bunch of useful helper functions that make things easier to read, like .appendTranslation for example
  • h

    hallowed-ocean-84954

    05/08/2023, 6:01 PM
    yeah - so does the openfl one
  • h

    hallowed-ocean-84954

    05/08/2023, 6:02 PM
    so if that's the case - just try binding using the matrix - does it work ?
  • t

    tall-teacher-57409

    05/08/2023, 6:05 PM
    I'm trying to, but how can I multiply a Vector4 by a Matrix4
  • h

    hallowed-ocean-84954

    05/08/2023, 6:06 PM
    there should be an API somewhere I would think. I normally do that in GLSL though - don't recall a case
  • t

    tall-teacher-57409

    05/08/2023, 6:07 PM
    Copy code
    hx
        var test_vec = new Vector4(1.0, 0.0, 0.0, 1.0);
    
            var transMat = [
                1, 0, 0, 0,
                0, 1, 0, 0,
                0, 0, 1, 0,
                0, 0, 0, 1,
            ];
    
            var trans:Matrix4 = new Matrix4(new Float32Array(transMat));
            trans.appendTranslation(1.0, 1.0, 0.0);
    
            trans.transformVector(test_vec, test_vec);
    I think like this?
  • h

    hallowed-ocean-84954

    05/08/2023, 6:07 PM
    openfl.geom.matrix3d has a transformVector() function
  • h

    hallowed-ocean-84954

    05/08/2023, 6:07 PM
    yeah ok
  • t

    tall-teacher-57409

    05/08/2023, 6:07 PM
    lol
  • t

    tall-teacher-57409

    05/08/2023, 6:07 PM
    👍
  • t

    tall-teacher-57409

    05/08/2023, 6:09 PM
    works alright

    https://cdn.discordapp.com/attachments/769686258049351722/1105194724488392795/image.png▾

  • h

    hallowed-ocean-84954

    05/08/2023, 6:10 PM
    btw, if it's of any help you can see all my code on gh - it's referred to in the project channel
  • t

    tall-teacher-57409

    05/08/2023, 6:13 PM
    thanks, im pretty excited to reach that far (although I took a look at further chapters and instantly pretended that I didn't 😅 ), but very awesome things I see you did 👌
  • h

    hallowed-ocean-84954

    05/08/2023, 6:17 PM
    I hesitated showing this because I didn't want to spoil your fun 🙂 And most of what I did is just what DeVries showed. So I can only take credit for haxe coding and bugs 🙂
  • h

    hallowed-ocean-84954

    05/08/2023, 6:18 PM
    But it's funny. Each time I got something working it was a buzz. Lots of fun. Lots of mistakes but lots of fun
  • t

    tall-teacher-57409

    05/08/2023, 6:21 PM
    lol yeah, its indeed very fun
  • t

    tall-teacher-57409

    05/09/2023, 7:42 AM
    is there a perspective view method in Matrix4 (like glm::perspective), I only find ortho
  • h

    hallowed-ocean-84954

    05/09/2023, 1:23 PM
    I don't see one. Openfl.geom.matrix doesn't have either - I just wrote my own utility functions for both projections.
  • h

    hallowed-ocean-84954

    05/09/2023, 1:24 PM
    BTW, did just passing a Matrix4 to uniformMatrix4fv() work or did you have to convert it ? I've been thinking I might switch my matrix code over to use Lime classes.
  • t

    tall-teacher-57409

    05/09/2023, 1:38 PM
    yeah it works in all demos so far
  • h

    hallowed-ocean-84954

    05/09/2023, 1:40 PM
    Nice. Thanx. It'll be a good thing to clean up in my stuff. This is one thing left over from starting in openfl that would be nice to get rid of
  • t

    tall-teacher-57409

    05/09/2023, 1:42 PM
    https://github.com/openfl/lime/pull/1681 I opened a pr but not sure if my implementation is right or not
  • t

    tall-teacher-57409

    05/09/2023, 1:42 PM
    I mimicked glm's implementation of it
  • t

    tall-teacher-57409

    05/09/2023, 2:14 PM
    how can I also get the screen width/height?
  • h

    hallowed-ocean-84954

    05/09/2023, 2:16 PM
    That's normally done when you create the window. The project xml has properties for it.
  • t

    tall-teacher-57409

    05/09/2023, 2:18 PM
    how can I retrieve these values?
  • t

    tall-teacher-57409

    05/09/2023, 2:18 PM
    o wait
  • t

    tall-teacher-57409

    05/09/2023, 2:18 PM
    I get it now
  • t

    tall-teacher-57409

    05/09/2023, 2:18 PM
    nvm
1...110111112...138Latest