Tag Info

New answers tagged

0

Ok after a lot of tries I made it,Stil I dont know if this is the best way to achieve this, if someone can explain why this is a solution it will be good! I just change the matrix mode to GL_PROJECTION and translate it gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0f, 8f, 0f, 4f, -1f, 1f); gl.glTranslatef(x, y, 0f); ...


0

You can use just the camera() method to change the perspective more easily. To use it, you probably want two variables: rotationAngle and elevationAngle. Moving the mouse sideways changes rotationAngle between 0 and TWO_PI. You can then set variable float centerY to sin(rotationAngle) and float centerX to cos(rotationAngle). Moving the mouse up and down ...


-1

It's best to do all of this in the GPU using the World and View matrices, not by modifying where you draw the objects on the CPU. That way, you can change the camera arbitrarily (even zoom it in and out!) and it will just magically work. You can still do view culling as well to save on draw time. And none of your code for drawing the world will have to ...


0

If your buildings have too many vertices, you should maybe reduce them by using simpler building models and adding details via Normal Maps instead of additional vertices. Additionally, if your buildings all use the same material then Unity's batching system will help reduce drawcalls to speed up rendering. Unfortunately, I can't really help you with this. ...


1

Can't speak to the exact implementation details (and if I could it would be off-topic), but here's some obvious ingredients to put together: The camera is using an orthographic projection. You can tell this because a vertical wall is exactly vertical on-screen no matter where it is — if the camera were perspective then they would be "leaning outward" from ...


0

You could define your "look at" point to be the same as current position. In this case, this line: XMVECTOR w = XMVector3Normalize(XMVectorSubtract(L, P)); will give you zero vector as forward direction, then you'll use it and of course there will be no movement Simple example: you're at (0, 0, 0) and your look at point is (0, 0, 0) Another possibility ...


2

This is an old question, so I'm guessing that tom37 may have moved on by now, but I think I have an answer for anyone else with the same problem. For reference, here is a view of a surface grid using a perspective camera. Now let's say that we want to render a portion of this current view, but to the entire screen. Let's render the top-left quarter of ...


0

So I have found the solution at last :P the problem was the position of the Touches were in pixels and i took them as for screen coordinates. So to fix it, float resultant_magnitude = Info.half_height / camera.orthographicSize * (prev_touch_position - t.position).magnitude; replace the above by this : float resultant_magnitude = Info.half_height / ...


0

Invert your thinking. Don't convert objects to camera space, convert the camera to object space. Start by clearing the output buffer including the stencil buffer. Sort the chunks in painterly order from back to front. Subdivide per usual transparency-drawing rules if needed. For each chunk: Clear the z-buffer and set the stencil buffer to mask anything ...


0

I didn't read your code but I think what you're looking for is something like this: var currentZoom, //The zoom % circleCenterX, circleCenterY, // The circles center for viewing dotX, dotY // The dots center for vieweing function zoomInOrOut(delta) // To zoom out use a negative value { if (delta < 0 && currentZoom <= 1.0) return; // ...


1

while zooming out, check if distance of red-dot and center of circle is more than circle's radius. (Lets call this distance, d) if so happened, move the circle in direction of V vector ( V = red-dot.position - circle.position`) for x unit. (x= d-circle's radius).



Top 50 recent answers are included