Giter Site home page Giter Site logo

Comments (8)

ffreyer avatar ffreyer commented on July 22, 2024 1

Seems to be

Makie.clip_to_space(scene.camera, markerspace) *
Makie.space_to_clip(scene.camera, space) *
Makie.f32_convert_matrix(scene.float32convert, space) *
model *
to_ndim(Point4d, to_ndim(Point3d, p, 0), 1)

If you add a parenthesis that include at least model * to_ndim(...) things work. Without them *(a, b, c, xs...) from Base runs, with
*(A::AbstractMatrix, B::AbstractMatrix, C::AbstractMatrix, x::AbstractVector) from LinearAlegbra. The former does a foldl, i.e. it multiplies the first two matrices first, the latter goes right to left. And the first two matrices are risky in terms of Float32 precision

WGLMakie computes the matrix product of the first two matrices directly as well, but in Javascript. I'm guessing it uses double precision.

Going left to right is quite a bit faster on it's own (14.9ns vs 20.7ns) and also useful for optimizing projections like [M1 * M2 * p for p in ps] to T = M1 * M2; [T * p for p in ps], so I think it would be best to just replace the camera matrices with Mat4d and convert to Mat4f as late as possible.

from makie.jl.

asinghvi17 avatar asinghvi17 commented on July 22, 2024

Is this common across all backends, and do you have an MWE?

from makie.jl.

juliohm avatar juliohm commented on July 22, 2024

Data: https://gist.github.com/juliohm/ca6ddae1995a5916c987282875ccadae

MWE:

using GLMakie
using DelimitedFiles

X = readdlm("data.csv", ',')

xyz = Tuple.(eachrow(X))

scatter(xyz)

from makie.jl.

asinghvi17 avatar asinghvi17 commented on July 22, 2024

I can replicate this on GLMakie and CairoMakie, but WGLMakie seems to give the correct result.

from makie.jl.

asinghvi17 avatar asinghvi17 commented on July 22, 2024

GLMakie
Screenshot 2024-06-20 at 11 36 38 AM

CairoMakie
iTerm2 OhCvv5

WGLMakie
Screenshot 2024-06-20 at 11 37 11 AM

from makie.jl.

ffreyer avatar ffreyer commented on July 22, 2024

This is not a new issue. I checked Makie 0.21, 0.20 and 0.19 and they all have it. Weird that it's backend specific...

from makie.jl.

asinghvi17 avatar asinghvi17 commented on July 22, 2024

Could this be a float precision issue then? The numbers are in that range...

from makie.jl.

ffreyer avatar ffreyer commented on July 22, 2024

Probably, but why is it not happening in WGLMakie?

from makie.jl.

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.