GeometryBasics.jl icon indicating copy to clipboard operation
GeometryBasics.jl copied to clipboard

fix Rect3 uv coordinates

Open ffreyer opened this issue 2 years ago • 4 comments

The current uv's in Rect3 are just the xy components of the coordinates. That means uvs are doubly assigned and not normalized. This pr adds some manual uvs so that

img = [
    RGBf(1,0,0) RGBf(0,1,0) RGBf(0,0,1);
    RGBf(0,1,1) RGBf(1,0,1) RGBf(1,1,0);
]

colors a cube. (Colors applying to the [+x, +y, +z; -x, -y, -z] face.)

ffreyer avatar Oct 08 '22 06:10 ffreyer

and not normalized.

They should be since I'm using the unit cube, no? Also, they need to return Vec3s, to work with 3d uvw coordinates...

SimonDanisch avatar Oct 17 '22 14:10 SimonDanisch

They should be since I'm using the unit cube, no?

Oh, you're right.

Also, they need to return Vec3s, to work with 3d uvw coordinates...

Why do we need 3d uvw coordinates though? From what I've seen working with 2d uv coordinates is much more common. Makie also doesn't accept 3d textures, e.g. mesh(Rect3f(Point3f(0), Vec3f(1)), color = rand(RGBf, 2, 2, 2)) errors. So you can't use them there.

ffreyer avatar Oct 17 '22 15:10 ffreyer

For volumes and for https://github.com/MakieOrg/Makie.jl/pull/2274

SimonDanisch avatar Oct 17 '22 15:10 SimonDanisch

Isn't it much more common to texture a surface than a volume though?

ffreyer avatar Oct 17 '22 15:10 ffreyer