Hello,
I need to get an up vector for a camera (to get the right look) from a roll, pitch, and yaw angles (in degrees). I've been trying different things for a couple hours and have had no luck :(. Any help here would be appreciated!
...
I'm working on a game for the xbox360, using XNA. On the Xbox the garbage collector performs rather badly compared to the one on a PC, so keeping garbage generated to a minimum is vital for a smoothly performing game.
I remember reading once that calling a delegate creates garbage, but now for the life of me can't find any references to...
Hey, I'm wondering if there's a function out there to set the length of an XNA framework Vector3, like in c++ it would just be VECTOR.setLength( x ).
Either that or the basic math to do it manually would be nice :)
...
I'm building a physics engine and i had some sort of "pseudo-verlet" thing going and i wanted to upgrade it to "real" verlet. So i found an article and set to work. After i added what i think is a good approximation, the engine doesn't work anymore. Can someone help me understand what i'm doing wrong?
My main physics body class's update...
I'm writing a physics engine that uses Verlet integration, and i can't get some constraints to work right. Some (like a bond/weld constraint) are extra "soggy" and aren't stiff enough, while others (like an area constraint) are extra bouncy and send atoms flying. The code for my update ethod in my physics simulator is like this:
Pr...
I have a physics simulation and it allows you to place area constraints, so that the bodies within will not exit that area. However if an atom goes past one of the "walls" of the area constraint it blows up the physics simulation. Why does it do this?
Update method:
if (!atom.IsStatic)
{
Vector2 force = Vector2.Zero;
bool x = fa...
I'm trying to add springs to my physics engine, and while the algorithm itself works, they are incredibly stiff ( have to feed in values <= about 0.1 to get any visible motion out of it, and it has to be set extremely small in order to work properly). Any tips for improving the following code so it's not as stiff with values in the 0.1 t...
I use XNA as a nice easy basis for some graphics processing I'm doing on the CPU, because it already provides a lot of the things I need. Currently, my "rendertarget" is an array of a custom Color struct I've written that consists of three floating point fields: R, G, B.
When I want to render this on screen, I manually convert this arr...
I'm a hobbyist programmer with a fair grasp of Python and I'm currently learning C. Recently I was talking to a colleague who also wants to learn to program. In his case, he wants to learn C++ as a path to Windows game programming using DirectX. Personally, I feel diving straight into C++ as your first language is a bit much - it's hard ...
I have and built and deployed the application created by the new project template for the zune hd. The problem is whenever the application exits, the Zune reboots. This happens when remotely debugging from the PC or when running it right from the device. It happens both in debug mode and release. I've included the basic template code, bu...
I have myself a linear grid of Vector2s stored in a Vector2[,] array, and i also have another Vector2 that lies within this grid. How can i simply extract both the nearest 4 grid points and their indexes in the array? I'm totally stumped...
...
Hello!
I read somewhere that when rendering a lot of 3D objects one could merge these to form a giant mesh so that only one draw call would be made. Therefore letting the, quote: "GPU do its magic", while the CPU is free for other calls than draw.
So to my question, would this be feasible to do in a 2D environment with performance in m...
I have a function that's called hundreds of thousands of times per update, and i need to optimize it. Now, i generally follow the "don't optimize too soon" rule but this is a critical function that virtually all of my code's time is spent in, so anything you can suggest would help. I'm also not that familiar with any sort of tips and tri...
Hi, I'm following the XNA 3.0 Game Studio Unleashed Book by Chad Carter.
I'm on chapter 4 and the following listing should render a textured triangle onto the game window but for the life of me I cannot figure out why it's not. I just get the plain cornflower blue screen.
I'm using Visual Studio 2008 with XNA 3.1
Those who have the bo...
I have a collision resolution method in my physics engine, that goes like this:
Vector2 n1pos = n1.NonLinearSpace != null ? n1.NonLinearPosition : n1.Position;
Vector2 n2pos = n2.NonLinearSpace != null ? n2.NonLinearPosition : n2.Position;
Vector2 posDiff = n2pos - n1pos;
Vector2 posDiffNormal = posDiff;
posDiffNormal.Normalize();
float...
Okay, I bet this question might have been asked dozens of times before, but at the end of the day, I am still confused.
I am working on a charting/plotting application. My application will also have WinForms controls.
Edit: Actually it's little bit more than a simple charting application. I need to plot hundreds of symbols on the plot....
Hi, I followed the tutorial on
http://www.david-amador.com/2009/10/xna-camera-2d-with-zoom-and-rotation/ to achieve a camera that follows my player sprite with zoom in/out functionality.
however, when I zoom in/out the camera seems to either slowly move away from the sprite whilst moving, I don't think I'm setting the position right, b...
Working on a 2D project and wanted some recommendations on a simple 2d physics library for use in C# with the XNA framework. I was looking at Farseer or physics2d. Anyone have any other suggestions?
Thanks!
...
Hello and sorry for the obscure title :}
I`ll try to explain the best i can.
First of all, i am new to HLSL but i understand about the pipeline and stuff that are from the fairy world. What i`m trying to do is use the gpu for general computations (GPGPU).
What i don`t know is: how can i read* the vertices (that have been transformed us...
I'm building a 3D game but i only plan on using a 2D perspective thus not taking the z axis into the equasion,
i want to be able to limit the movement of one of my models so it doesn't move out of the unmoving field of view,
when i was designing 2D it was simple just use clamp, but i cant seem to figurebout how to do this in 3d
any hel...