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

How to create a cubemap? #279

Open
tod91 opened this issue Aug 9, 2022 · 3 comments
Open

How to create a cubemap? #279

tod91 opened this issue Aug 9, 2022 · 3 comments

Comments

@tod91
Copy link

tod91 commented Aug 9, 2022

I see that you support a skybox, but is there an easy way to make a cube map im trying to make a pair of dice.

@danaugrs
Copy link
Member

danaugrs commented Aug 10, 2022

Hi! Yeah, skyboxes in G3N use cube mapping. If you want to texture cubes as dice you need to associate a different material with each cube face. Each cube face is already in a different geometry group to simplify this process. You just need to call mesh.AddGroupMaterial(diceFaceMaterial2, 2) for each cube face. For example, check out how it's done in Gokoban here (where we alter a single cube face) or how we do it for skyboxes here (where we set a different texture+material for each face).

@tod91
Copy link
Author

tod91 commented Aug 10, 2022

@danaugrs Hey, thanks for the reply! Works beautifully. The thing i'm concerning myself now
Screen Shot 2022-08-10 at 5 16 18 PM
is that the edges seem very sharp as shown here
is there a way to smooth em out i'm planning them to rotate them and have a clean collision detection, meaning as they are now if htey land on their edge the will rotate on some really , for lack of a better word, shady position.

@danaugrs
Copy link
Member

danaugrs commented Aug 12, 2022

You would have to create the 3D model with the edges smoothed out. It's straightforward to do it in Blender e.g. https://www.youtube.com/watch?v=wYBkLrca67Q.

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

No branches or pull requests

2 participants