xna

Ray intersection with 3D quads in XNA?

会有一股神秘感。 提交于 2020-01-11 09:43:09
问题 So I have successfully made a ray the represents the mouse unprojected into the world, and now I need to check if that ray can intersect with a quad object, here is the code I use to get the ray: public Ray GetMouseRay() { Vector2 mousePosition = new Vector2(cursor.getX(), cursor.getY()); Vector3 nearPoint = new Vector3(mousePosition, 0); Vector3 farPoint = new Vector3(mousePosition, 1); nearPoint = viewport.Unproject(nearPoint, projectionMatrix, viewMatrix, Matrix.Identity); farPoint =

Rendering graphics in C#

喜欢而已 提交于 2020-01-10 14:38:22
问题 Is there another way to render graphics in C# beyond GDI+ and XNA? (For the development of a tile map editor.) 回答1: SDL.NET is the solution I've come to love. If you need 3D on top of it, you can use Tao.OpenGL to render inside it. It's fast, industry standard (SDL, that is), and cross-platform. 回答2: Yes, I have written a Windows Forms control that wraps DirectX 9.0 and provides direct pixel level manipulation of the video surface. I actually wrote another post on Stack Overflow asking if

How can I correct TouchPanel offset bug with Windows Phone XNA game on WP8 720p devices?

允我心安 提交于 2020-01-07 05:52:37
问题 XNA apps (WP7 or WP7.5 apps) that run on a WP8 720p device will get automatically letterboxed so the 480x800 BackBuffer size stays the same (for compatibility I presume). This would be fine, except there appears to be a bug in the XNA compatibility layer. The TouchPanel reports touch locations that are off by the size of the top letterbox blank area. This has two problems: The user's touches will appear to be off making gameplay and menu navigation difficult. Because it is off in the negative

Object in sphere(bounding sphere), want it to restrict movement within sphere

余生长醉 提交于 2020-01-07 05:31:11
问题 So how can I constraint movement of my object ONLY in a Sphere? I tried with the bounding box and the intersection method but it doesn't seem to work? Edit 1 : this was not a question... i was asking this: i have 2 bounding spheres, one big and one small , the small will be moving inside the big but i dont want it to go outside the big bounding sphere how do i do it? 回答1: The distance of the center of the small sphere from the center of the big sphere must never be more than (BigRadius -

Unload the texture2D that I want to Unload

浪子不回头ぞ 提交于 2020-01-07 05:05:26
问题 I would like to Unload some Texture2D without Unloading everything. Should I create a ContentManager for each Texture2D that I'm supposed to Unload later ? These Texture2D don't have to be Unloaded at the same time) There's something I didn't understand but I don't know what... 回答1: Short answer is yes... although I suspect you may want to opt for groups of textures per content manager instead. e.g. all the textures for a given level / scene etc. 来源: https://stackoverflow.com/questions

create tiling texture plane xna

橙三吉。 提交于 2020-01-07 04:55:10
问题 I want to create a plane using xna , similiar to the one in this link so i can add 3d objects above it http://www.mathsisfun.com/geometry/plane.html can anyone guide me or tell me how? 回答1: what you want to draw is a textured quad: http://msdn.microsoft.com/en-us/library/bb464051.aspx 来源: https://stackoverflow.com/questions/4526717/create-tiling-texture-plane-xna

foreign culture XML text parsing

大憨熊 提交于 2020-01-06 14:11:14
问题 I have released a windows phone app a while back. Since then, BugSense reported a problem that is causing some crashes in foreign countries: System.ArgumentException - The character 'İ' (0x0130) is not available in this SpriteFont. If applicable, adjust the font's start and end CharacterRegions to include this character. Parameter name: character and here is the stack trace: at Microsoft.Xna.Framework.Graphics.SpriteFont.GetIndexForCharacter(Char character) at Microsoft.Xna.Framework.Graphics

foreign culture XML text parsing

流过昼夜 提交于 2020-01-06 14:10:09
问题 I have released a windows phone app a while back. Since then, BugSense reported a problem that is causing some crashes in foreign countries: System.ArgumentException - The character 'İ' (0x0130) is not available in this SpriteFont. If applicable, adjust the font's start and end CharacterRegions to include this character. Parameter name: character and here is the stack trace: at Microsoft.Xna.Framework.Graphics.SpriteFont.GetIndexForCharacter(Char character) at Microsoft.Xna.Framework.Graphics

Declaring 2d array in XNA

家住魔仙堡 提交于 2020-01-06 14:00:11
问题 6 images 800x640 need to be rendered from a point of view, and based on these images one new image 800x640, a sort of fish-eye view, should be created. At the moment the application draw each image and read the colors by calling this RenderTarget2D.GetData method and based on each pixel position it calculates new position for that final image. It works fine. but since calling RenderTarget2D.GetData reduces the performance I tried to declare a 800x640 array in shader and then render 6 images

XNA - how to tell if a thumb stick was “twitched” in a certain direction

最后都变了- 提交于 2020-01-06 10:55:22
问题 Is there anything in the API (3 or 4) to tell me if the stick moved in one direction, as in a menu where it's equivalent to hitting a direction on the DPad? There appear to be some Thumbstick* members in the Buttons enum, but I can't find decent documentation on them. Just want to make sure I'm not missing something obvious before I go and roll my own. Thanks! 回答1: There is no XNA method to tell you if a thumbstick was "twitched" this frame. The easiest method is to store the old thumbstick