Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Rect3 uv coordinates #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Oct 8, 2022

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.)

@sjkelly sjkelly requested a review from SimonDanisch October 17, 2022 14:17
@SimonDanisch
Copy link
Member

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...

@ffreyer
Copy link
Collaborator Author

ffreyer commented Oct 17, 2022

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.

@SimonDanisch
Copy link
Member

For volumes and for MakieOrg/Makie.jl#2274

@ffreyer
Copy link
Collaborator Author

ffreyer commented Oct 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants