Tag Info

New answers tagged

0

To get 2d screen coordinates from a 3d world space location, you would use Viewport.Project, not Viewport.Unproject. The world matrix to put in the Project method would be the same one you use to set the effect.World property for rendering.


4

Texture2D objects are allocated on system memory, but the actual textures loaded from image files are, on the other hand, loaded on the graphics card's memory. You are not completely off with your assumption, but here is how it goes when you want to load and render a simple texture: You load the texture into the graphics card's memory. You bind the ...


1

You want a git post-commit or post-push hook to invoke your build chain automatically every-time those things happen. http://git-scm.com/book/en/Customizing-Git-Git-Hooks (Or you could use Jenkins? Same thing, but more complex. Though you might like those features.) Simply google "automated clickonce" to see that click once is not intended to be ...


3

Game assets like sounds are usually best managed if preloaded in advance. You don't want the user to experience a delay in the sound effects every time a sound has to be loaded. You should implement a ResourceCache helper that manages game resources for you. Then things like sounds could be preloaded at each level start and unloaded when the level ends. ...


0

What you are looking for is the Object Pool pattern which provides reusability and efficient memory usage. At the initialization level of the application, you simply create the instance and give it to the object pool. When you need to use it, pop it from the pool and send it back to the pool after you finish. In this way, you don't have to instantiate a new ...


0

You can use only the distance, without use the sqrt and the Pow because the distance is usually calculate with this formula: float dist(vector3d v1, v2) { v.x = v1.x - v2.x; v.y = v1.y - v2.y; v.z = v1.z - v2.z; return sqrt(v.x*v.x + v.y*v.y + v.z*v.z); } as you can see here.


1

Yeah, this is how spritebatch is meant to be used. It takes a view matrix in the begin parameter and uses that throughout the begin/end pair. You could argue that spritebatch would be more flexible with matrices if you could pass a view matrix in for each .draw call, but evidently the XNA team decided against this for one reason or another. To answer your ...



Top 50 recent answers are included