Tag Info

Hot answers tagged

2

Something like this: transform.position = player.transform.position - player.transform.forward * distance; transform.LookAt(player.transform); where float distance is the distance of camera form player Consider also the solution 2 : Make camera child of player and in your player die script , you can "deatach" camera from player object transform.parent ...


2

As mentioned above, you can start and stop a SpriteBatch in the same draw-method, also for transparency you need to enable BLEND. Here's what I did with one of my UIs. batchstuff... spriteBatch.end(); Gdx.graphics.getGL20().glEnable(GL20.GL_BLEND); Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); ...


2

1)Create a plane that usually contain a point and a normal that represents the floor. 2)Reflect your camera position and rotation from this plane. 3)Create a view matrix from these point and rotation. 4)Render scene from this matrix into a texture. 5)Transmiss those texture and matrix into a shader. 6)Project texture onto a surface of floor using ...


1

I'm assuming you are using two different cameras (as you probably should). If so, then the script below should work for what you want. Attach this script to the player (or any gameobject that is always active in your scene). Then be sure to assign the cameras to the script from the inspector. When you are switching cameras, particularly from the other cam ...


1

As someone who has implemented an entire Math library including Quaternions let me say that just following a tutorial will not get you anywhere with this. To iron out bugs like this you really need to understand how Quaternions work, what they are and how to use them. It's probably some of the most complicated math in Game development and I don't recommend ...


1

Well, a very basic linear interpolation pattern goes like this (pseudocode): currentVelocity = currentVelocity + (interpolationRate * (targetVelocity - currentVelocity )) Calling this on update instead of directly setting the current velocity will do what you requested, the transition speed is adjustable by adjusting the interpolationRate value (between ...


1

I've managed to get it working by fiddling around and it would seem that this works as I wanted. `shape.setColor (Color.WHITE); shape.rect ((Constants.RENDER_WIDTH - 500) + (camera.position.x - (camera.viewportWidth * camera.zoom) / 2) / 30, (camera.position.y - (camera.viewportHeight * camera.zoom) / 2) / 30, (Constants.RENDER_WIDTH * camera.zoom) / ...


1

Since you are working in 3d world space, why not use the BoundingFrustum class? BoundingFrustum cameraBounds = new BoundingFrustum(view * projection); if(cameraBounds.contains(location)) { // it is in view } else { // not in view } edit. I assumed you are using XNA. If not, you can still reflect the XNA code to see how to make a Bounding frustum ...



Only top voted, non community-wiki answers of a minimum length are eligible