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

    tall-teacher-57409

    05/09/2023, 2:19 PM
    ty 👍
  • h

    hallowed-ocean-84954

    05/09/2023, 2:19 PM
    👍
  • t

    tall-teacher-57409

    05/09/2023, 2:20 PM
    I don't find them in my project.xml :/
  • h

    hallowed-ocean-84954

    05/09/2023, 2:20 PM
    Are you specifying them in your lime application create code somewhere ?
  • t

    tall-teacher-57409

    05/09/2023, 2:21 PM
    nope
  • t

    tall-teacher-57409

    05/09/2023, 2:22 PM
    is it
    lime.ui.Window.width
    ?
  • h

    hallowed-ocean-84954

    05/09/2023, 2:23 PM
    maybe - I was thinking lime.application.Window - but I need to look up the path - checking what I'm doing
  • h

    hallowed-ocean-84954

    05/09/2023, 2:24 PM
    again because of openfl I use stage.window.height - which I think will map down to the lime application window
  • t

    tall-teacher-57409

    05/09/2023, 2:25 PM
    ah that one did it, thank you
  • h

    hallowed-ocean-84954

    05/09/2023, 2:26 PM
    the stage ? I thought you weren't using openfl ? oh lime.application.window ?
  • t

    tall-teacher-57409

    05/09/2023, 2:26 PM
    yeah lime.Application.current.window 👍
  • h

    hallowed-ocean-84954

    05/09/2023, 2:27 PM
    cool
  • t

    tall-teacher-57409

    05/09/2023, 2:34 PM
    I'm attempting to replicate this demo, I've spent half the day trying to, but can't get the right result. No errors, and the application compiles successfully, but its all when I do
    Copy code
    glsl
    gl_Position =  proj * view * model * vec4(aPos, 1.0);
    in the vertex shader, can't figure out what's wrong here (the container doesn't show up but it does when I remove the proj, view, and model, and leave the
    vec4(aPos, 1,0))

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

  • t

    tall-teacher-57409

    05/09/2023, 2:35 PM
    Copy code
    hx
    model = new Matrix4(new Float32Array(transMat));
                    model.appendRotation(-55.0 * js.lib.Math.PI / 180, new Vector4(1.0, 0.0, 0.0, 1.0));
    
                    view = new Matrix4(new Float32Array(transMat));
                    view.appendTranslation(0.0, 0.0, -3.0);
    
                    proj = new Matrix4(new Float32Array(transMat));
                    createPerspectiveZO(proj, 45.0 * js.lib.Math.PI * 180, Application.current.window.width / Application.current.window.height, 0.1, 100.0);
    these are the transformed matrices
  • h

    hallowed-ocean-84954

    05/09/2023, 3:00 PM
    What is transmat ? Does it translate ? If you apply translation before rotation you will rotate the translated coord which can land in deep space. I would start with 0, scaling rotation and translation of the model first.
  • t

    tall-teacher-57409

    05/09/2023, 3:00 PM
    trans mat is a normal matrix identity, no it doesn't
  • t

    tall-teacher-57409

    05/09/2023, 3:00 PM
    alright will do the latter
  • t

    tall-teacher-57409

    05/09/2023, 3:01 PM
    i think I forgot about Matrix4.identity though
  • h

    hallowed-ocean-84954

    05/09/2023, 3:01 PM
    If it's identity then it should be fine
  • h

    hallowed-ocean-84954

    05/09/2023, 3:01 PM
    Yeah clearer if you start with the identity method
  • t

    tall-teacher-57409

    05/09/2023, 3:01 PM
    alr 👍
  • t

    tall-teacher-57409

    05/09/2023, 3:05 PM
    I got
    Copy code
    hx
                    model = new Matrix4();
                    model.identity();
                    model.appendRotation(-55.0 * js.lib.Math.PI / 180, new Vector4(1.0, 0.0, 0.0, 1.0));
    
                    view = new Matrix4();
                    view.identity();
                    view.appendTranslation(0.0, 0.0, -3.0);
    
                    proj = new Matrix4();
                    proj.identity();
                    createPerspectiveZO(proj, 45.0 * js.lib.Math.PI * 180, Application.current.window.width / Application.current.window.height, 0.1, 100.0);
    
                    gl.uniformMatrix4fv(gl.getUniformLocation(program, "model"), false, model);
                    gl.uniformMatrix4fv(gl.getUniformLocation(program, "view"), false, view);
                    gl.uniformMatrix4fv(gl.getUniformLocation(program, "proj"), false, proj);
    now (forgot
    ()
    )
  • t

    tall-teacher-57409

    05/09/2023, 3:05 PM
    still nothing yet 😞
  • h

    hallowed-ocean-84954

    05/09/2023, 3:22 PM
    My guess is the model ends up outside the frustum. Play with the z axis translation or the near and far plane of the projection matrix. If be inclined to not translate first. Hopefully you end up inside the model. If it's any consolation I had a lot of trouble with this initially too.
  • t

    tall-teacher-57409

    05/09/2023, 3:23 PM
    > If it's any consolation I had a lot of trouble with this initially too. good to know it's not only me 😭
  • t

    tall-teacher-57409

    05/09/2023, 3:23 PM
    alright will do 👍
  • t

    tall-teacher-57409

    05/09/2023, 3:28 PM
    bruh no luck, I tried the suggested but nothing changes it perhaps im doing something dumb and don't notice
  • h

    hallowed-ocean-84954

    05/09/2023, 3:31 PM
    Perfectly possible. Like row verses column major in the matrix
  • h

    hallowed-ocean-84954

    05/09/2023, 3:43 PM
    When I got stuck like this I would go through the chapter section again. Then I would walk through my code and make sure I was binding all the uniforms properly and even make sure I hadn't forgotten to draw which I did at least once
  • t

    tall-solstice-92437

    05/09/2023, 10:18 PM
    @tall-teacher-57409 you get the perspective matrix working right? I have one in my math lib you can use as a reference
1...111112113...138Latest