-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
Guide on how to texture an object #44
Comments
You should look up uv mapping. Here's an explanation: https://www.youtube.com/watch?v=scPSP_U858k |
Thanks, I indeed looked up UV unmapping. I'm just unsure about how to make that work in Ursina. Let's just assume that basic example of enhancing the Minecraft code sample. Let's say, I want to give it a grass texture which would consist of 6 images (= 6 sides of a cube)... how would I do that?
|
The uvs are part of the model, so you don't have to do anything, just set the texture you want (texture='file_name'). The easiest way to make a cube like that would be to replace the model with a custom one that's unwrapped how you want it. While it's possible to use 6 quads and 6 images to make one cube, it a bad idea since it's ~6 times less performant. If you want to change the uvs in ursina without using a 3d program, you can modify/set model.uvs and then call model.generate() to update it. |
Thank you for the explanation! I didn't know it was that simple. |
Again, I've got a question. I've right now used the Blender default cube and scaled it by 0.5 along all axes (because I've seen that it's 2x2x2 by default). I switched to Edit Mode and checked the UV map. It was fine but just for the sake of correctness I pressed "u > UV Unwrap". I had 6 tiles, so I combined them with ImageMagick into a single quadratic 512x512 cubemap so that it fits the Blender unwrapping. As you can see in the image, I had to rotate each side by 90 degrees for them to show up properly. Now it's looking good but not entirely perfect. I can see slim white lines on the edges of my cube - in my game as well as in Blender when applying the cubemap texture. However, I can't see the lines in my cubemap.png . Do you know if I'm doing anything wrong? |
I believe those are uv seams. The common way to solve that is to extend the edges in the texture so there's less white space around the shape. |
why is this so frickin hard |
how do i make my own textures using blender btw pokepetter if u see this u might know me as |
Hi. |
The way I check for collisions is first:
|
what software do you recommend because i have had no luck in finding any good free ones. |
Blender is probably the best free one, even it's very hard to use. |
I made that comment a while ago. since then, I have already learned blender. thanks though. |
This game engine is amazing! Unfortunately, especially to those not so experienced with 3d modelling / game development in general, it's quite hard to understand how to apply textures to the models.
A guide on that would be great. Just two examples which I don't know how to realize:
I have a cube entity. The default one. How can I create a cube map texture (so not the same texture for every side of the cube) for it through the official Ursina engine? What does my texture need to look like? What methods do I need to call? Maybe I would like to texture your Minecraft code sample.
I have modelled some basic stuff in blender. Let's say it's a low-poly car. I just switched to edit mode, pulled around some corners and then exported to a .obj file. How would I texture that one? Would I have to apply textures in Blender and somehow export them? I'm lost.
Thank you for your great work so far!
The text was updated successfully, but these errors were encountered: