Answer Questions
PhilipDaniels Drawing colored meshes using own effect
I want this easy thing to work -- but apparantly it's not that easy for me. I simply want to load a colored mesh from a file, and draw it on my screen using a custom effect. The mesh(es) load just fine in DXViewer, and also no problem when I'm using the BasicEffect to draw the mesh. The mesh is drawn at the correct position/scale, but the colors are wrong. They seem to be random, and sometimes they change during runtime. I've posted the relevant XNA code below. Of course it's incredibly rediculous to put all this code in the Draw method, but it's just to show you all the relevant code together. So here we go: protected override void Draw( GameTime gameTime) { CompiledEffect compiledEffect = Effect .CompileEffectFr ...Show All
Jason D. Camp Game Component Serialization
Hi I have been working on a Level Editor and have run into some problems with serializing my scene graph. Sticking with the game component idea for the moment, all the objects in my scenegraph are currently DrawableGameComponents. Using the nifty XmlSerializer class I can easily store my scene graph with all its children and load it at a later time. However, this requires every class being serialized to have an parameterless contructor and all GameComponents requires the Game as a parameter. The Game Property of GameComponent is unfortunately a readonly property and cannot be set after serialization. This causes problems since my game objects relies on services provided by the game. Any ideas will be appreciated. Thanks Johan ...Show All
nsinghal 2D Animations
Am use the Animation class that I found in the xna doc under 2D. I would like to a Shape class that take two animation classes. So that I could do something like this: currentShape = new Shape(anim1, anim2); currentShape.Draw(sb, anim1.pos, anim2.pos, Color.White); In the xna docs under Progammer guid. There is a explame of a animation Class. What I have is 10 animation image maps. Right now am able to use rand(0,9) to draw one of the animation map to the screen and have it fall down. But I need two of them like this: A BA B AB B A Where A&B are are the animation maps. A will r ...Show All
blixt174963 HLSL Syntax Highlighting in XNA Express?
This is incredibly minor, but are there any plans to add HLSL Syntax Highlighting to XNA Studio Express Shaders aren't going away for a while, and it would be quite useful to have some syntax support in XNA. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=201508 Shader highlighting is disabled for Express Shader highlighting is already in full VS as long as you install the DirectX SDK Shader debugging has moved to PIX with the August 06 SDK - see http://msdn.microsoft.com/directx/sdk/ though I've not tired it yet to see how useful it is Hang on a minute, shouldn't those of us who have shelled out a fortune to get the pro version of VS2005 get that first Seriously though, it is a ...Show All
Ole Jepsen help with Pan Tilt and Zoom with simple 3D Cube
Hey guys and gals, I'm sort of new with XNA and programming with C# in general. I created a simple 3d cube and using this thread as a reference. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=687936&SiteID=1 I also created a keyboard component for my input as I want to manipulate the camera such as you would in a FPS game. My problem is that I tried to these lines of code to accomplish that and it doesn't seem to work. I have these under the Update section of my code. What am I doing wrong if (keyboardComponent.IsKeyDown( Keys .W)) { //zoom into object mCameraPosition.Z-=1.0F; } if (keyboardComponent.IsKeyDown( Keys .S)) { //zoom out mCameraPosition.Z+=1.0F; } if (keyb ...Show All
Leigh Moore Rendering To Textures in Beta2
I used Texture2D's heavily with the usage RenderTarget, however in Beta 2 its like a whole new API. I understand that Surface no longer exists and RenderTarget/2D should be used. The problem is, the whole mentality is backwards compared to what im used to. From what I see I should create a RenderTarget2D and set that as a render target, then do rendertarget.GetTexture() if I want to set it. Thats fine. However, how do I copy between render targets There is no StretchRect or equivelent function I can see, which I used alot before. Surely I dont have to go about getting a texture, setting it, creating a 'copy' effect, setting a new render target, resolving the new render target just to copy from one to another Is there no alte ...Show All
Peter Richard MDX and Vista
Will managed DirectX (for .NET 1.1) come pre-installed on Windows Vista when it is released How about the .NET 2.0 framework I'd like to see the MDX libraries included in Vista, and also in XP service pack 3 (if there ever is one). -Jeremy Thanks for the info Mike. I hear IE7 will include the .NET framework, which is a good thing. > No .Net 1.1 isn't included. Ok, I guess Dell installs .Net 1.1 on new computers. -Jeremy The official MS policy is only to ship OS core fixes and additional driver type stuff in service packs. For example I tried very very hard to get .Net framework 2.0 included in SP2 and it never happened (bear in mind I was an internal ...Show All
javarg Multi-sampling and MRT ???
Hi there, is it possible to have surfaces with multi-sampling and do multi-render target at the same time If so, what would be the correct order or procedure to make it work any link As stated in the documentation MRT and multisampling is not supported at the same time. ...Show All
srichand Host you tutorials and downloads with us!!!
Hey everyone!!! I just want to let everyone know that we have a new resource site at http://www.xnaresources.com and we would be happy to host any tutorials people have written or any file downloads for source code and projects... Just drop us an email at contact@xnaresources.com and we will post whatever you need posted. Thanks, I posted a link to your tutorial this morning... I also wrote up a little blog article about it... The link is in our links directory under the games section and tutorials section. Thanks for the heads up! Jason Jaegers www.XNAResources.com Yeagermeister, I have my own hosting, but I just wanted to tell you I just posted a tutorial and source code for a breakout clone using XNA. The URL is ...Show All
davep1553 Managed Direct3D 10
Since XNA only supports DirectX 9.0 Where is Managed Direct3D 10 I hope there will be Managed wrapper for Direct3D 10 thanks Well, a managed version of DirectX 9 was offered as part of the DirectX 9 beta some years ago. Therefore we have a managed solution for the same time and there are still not many games written in managed code. I don’t want to sound insulted but what makes you think that Microsoft could build a better designed, better documented and faster managed Direct3D 10 than anybody else There are rules how to design managed libraries and MDX 1.1 ignore them more than one time for speed reason. Have you looked at the MDX 1.1 documentation lately I don ...Show All
Jina 3D model importer
Does anyone have any info or tutorials about making a 3D file importer for either .obj or .x (prefered .obj) I am a new game developer and a friend and i are making a simple game, but while i know much C# i know nothing about accessing outside files (Like makeing a config or save file or reading a .obj) and i have no idea how this would be accomplished i jhave reasearched but it was fruitless, maybe i just missed something i dont know... [edit] i read the post in the tutorials section but it didnt help because as i said i dont know how to work with external files... You can check this thred about my fbx ascii importer, there is a link to a obj to fbx converter in the 2nd post. http://forums.microsoft.co ...Show All
LPJ XNA Framework Docs?
Is there any XNA documentation that is publically available at this point I have seen FAQs, etc., but the framework itself seems to be a bit of a mystery (in terms of implementation). Am I missing something No. The documentation, samples, and starter kits will be available with the release of the XNA Game Studio Express product on August 30th (and please bear in mind that the release is an early beta, so documentation may be sparse in some places). Jim Perry wrote: David Weller wrote: No. The documentation, samples, and starter kits will be available with the release of the XNA Game Studio Express product on August 30th (and please bear in mind th ...Show All
WQP Alpha Blending (deferred)?
Is there a way using the sprite batch object that you can render several rectangles, but when alpha blended, it looks like the entire object was rendered first as a single opaque image, and then that image was alpha blended, such that you would never have known it was several smaller pieces assembling the final object Instead of normally seeing each rectangle blended as it overlays another rectangle. Is there no other option I would think that would be really slow. Depth or stencil can be used for "first write wins", but not for "last write wins" or "all the writes on a layer are blended together, then that layer is blended with the one belo ...Show All
Charles Cox - MSFT space war input problem
space war don't respond on my keyboard actions Hey is there any way to get a normal windows/pc joystick/gamepad working with xna No. Well nothing official. In windows you could try adding the MDX 1.1 Directt Input assemblies - but I wouldn't be surprised if that fails Or you could write your own managed DirectInput wrapper Or you could write your own Raw windows message wrapper and pick up the gamepad messages that way. But unless you earn $2000 an hour I imagine its probably cheaper in the long run to go and buy a couple of xbox controllers :-) That's because it's expecting a wired controller. You'd have to change it to use the keyboard. Maybe I'll look into doing that. ...Show All
Mr.V. Orienting 3D objects along a velocity vector
I'm working on a bullet/missile class for my 3D game and I'm struggling with trying to figure out how to construct the rotation matrix to have my mesh oriented with the direction of my velocity vector (a Vector3). It seems like it should involve two rotations (since one axis will be the up-vector) and probably a little bit of Math.atan2 magic. Can anyone help me out Divided by the product of their magnitudes. I'm typing this from work and don't have the XNA docs in front of me and can't remember the function names but mathematically it would look something like this. v1=natural direction v2=direction you want to point. vaxis=cross_product(v1,v2) angle=acos( dot(v1,v2)/( v1.Magnitude()*v2.Magn ...Show All
