Tag Info

Hot answers tagged

5

Use a 3D vector. For your 2D components, simply ignore the third component. The extra "cost" of an unused float is trivial in comparison to the rest of your architecture, and things like std::unordered_map<std:;string, Component*> are of far greater performance and memory concern than an occasionally-unused float anyway. You say that this would be ...


4

What shapes are you using? If your shapes are convex (like circles, squares, rounded rectangles), you can just draw versions of different size and clip them to a triangle whose diagonal goes from upper right to lower left. I.e., zoomed in, light-to-dark: and dark-to-light: Then clip that: And then combine the two bezels: and finally draw the ...


3

I've never had this problem before, but I've also noticed you're using BufferUsage.None. This enum has two possible states: None and WriteOnly. In all my coding, I've always used WriteOnly. From the documentation for BufferUsage, it states that WriteOnly does the best memory location for writing/rendering, but the downside is you can't read the data from ...


1

You need to think with Portals :-) Make the playing field large enough that a player can't see from one end to the other (e.g. using fog). That way, a player can never see two instances of the same opponent. Of course weapon ranges need to be limited appropriately as well. Then, when a player nears the edge of the playing field, just draw a second copy of ...


1

The transformation Matrix to transform from the space on the left to the space on the right is [1 0 0 1 ] [0 1 0 -1.5] [0 0 1 0 ] [0 0 0 1 ] Well this is not correct, the matrix you have shown is actually to transform any point from the space on the right to the space on the left. The correct matrix to transform from the ...


1

The documentation shows the correct usage of the NinePatch: public NinePatch(TextureRegion region, int left, int right, int top, int bottom) left - Pixels from left edge. right - Pixels from right edge. top - Pixels from top edge. bottom - Pixels from bottom edge. Additionally you can find a tutorial ...


1

That is not really an accurate normal map, by the way. You are just sort of assuming that the regions of the image where the luminance varies correspond with surface contours. That is frequently the case, but not necessarily - particularly in a subject this filthy, there will be a lot of dirty areas that appear to a sobel filter as contours rather than just ...


1

First of all, I think the grid is pseudo-3d: 2D movement area, but create vertical lines when the height changes. Given that, check this answer, as the same principle applies.


1

Create your points so they form a solid line on a 2D plane. Walk the line starting with a point that's on ground level, for each point: If the ground is above or below the current position, add a new point, and shift the existing point and all remaining points up or down to meet the height of the ground. -Continue until all points have been touched. You ...



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