Giter Site home page Giter Site logo

Comments (13)

CREATOR118 avatar CREATOR118 commented on July 17, 2024 10

why is this so frickin hard

from ursina.

pokepetter avatar pokepetter commented on July 17, 2024

You should look up uv mapping. Here's an explanation: https://www.youtube.com/watch?v=scPSP_U858k

from ursina.

famecastle avatar famecastle commented on July 17, 2024

from ursina.

pokepetter avatar pokepetter commented on July 17, 2024

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.

from ursina.

famecastle avatar famecastle commented on July 17, 2024

Thank you for the explanation! I didn't know it was that simple.

from ursina.

famecastle avatar famecastle commented on July 17, 2024

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.

cubemap2

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.

image

However, I can't see the lines in my cubemap.png . Do you know if I'm doing anything wrong?

from ursina.

pokepetter avatar pokepetter commented on July 17, 2024

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.
For pixel graphics you can just disable the bilinear filtering with Texture.default_filtering = None

from ursina.

CREATOR118 avatar CREATOR118 commented on July 17, 2024

how do i make my own textures using blender
and i need it to be a png uv map

btw pokepetter if u see this u might know me as
"THE_godof_death" from your discord server :)

from ursina.

kkhashayar avatar kkhashayar commented on July 17, 2024

Hi.
Can you please explain how I can use collision!? in 2D mode between two objects, it looks very complicated!
Thanks a lot.

from ursina.

Borrito0 avatar Borrito0 commented on July 17, 2024

The way I check for collisions is first:

  • adding the box collider to an Entity: your_model=Entity(model='quad',color=color.white,scale=(1,1),position=(0,0),collider='box')
    -then doing the same thing with another object
  • and then checking for a collision in the main loop:
    def update():
    hit_info=your_model.intersects()
    if hit_info.hit:
    #Do whatever you want

from ursina.

 avatar commented on July 17, 2024

You should look up uv mapping. Here's an explanation: https://www.youtube.com/watch?v=scPSP_U858k

what software do you recommend because i have had no luck in finding any good free ones.

from ursina.

venaxyt avatar venaxyt commented on July 17, 2024

Blender is probably the best free one, even it's very hard to use.

from ursina.

 avatar commented on July 17, 2024

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.

from ursina.

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.