New answers tagged

1

The difference between ScreenSize and WorldSize is part of the brilliance of graphics systems like OpenGL. ScreenSize is the actual size of the window in pixels. When the user grabs the window handles and resizes the window, then ScreenSize will change. WorldSize is the size of your game level or "World". It is completely arbitrary. In a 2D game, 1 unit in ...


0

I am not aware of an easy way of doing this. The way I'd do this is the following: Determine XY position of click on texture (x = 0..1, y = 0..1) How to do this depends on where you use it, but will likely require raycasting. Go to the camera that sends the image to the texture. Assuming the camera uses perspective projection: Calculate the 3D ...


2

Math.acos() solution I have something very close to what I am looking for but I beleive there is an even better way of doing this. I started by plotting a graph using Desmos. I was actually looking for a less steep curve at the beginning but I think this is close enough to what I'm looking for. In this representation the Y axis is the velocity and the X ...


5

Convert your image to grey-scale. Make sure you have no two states that have the same grey. (You have to tweak the image.) Have an infrastructure that maps the grey colour to a state. Then when you mouse-over the map, pick the pixel colour that is under the mouse pointer, and search for it in the map. You'll know what state you want to select this way.


0

From my own experience, I've found that using the sum of components (x + y + z) is a very good measure for sorting entities in an isometric scene. It doesn't perfectly represent the distance your image is away from the camera, but it does give an indication which image is further or closer to the camera, and that's what ultimately matters. Moreover, sums are ...


0

I did it! Yay, I'm so proud! :P Ofc I didn't stopped to google, and I found my answer in a depth buffer. What I'm currently doing is the following stuff Gdx.gl.glClearDepthf(1f); Gdx.gl.glClear(GL20.GL_DEPTH_BUFFER_BIT); //1. set the function to LESS Gdx.gl.glDepthFunc(GL20.GL_LESS); //2. enable depth writing ...



Top 50 recent answers are included