Jump to content
Xtreme .Net Talk

igotjunk

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by igotjunk

  1. Animation Controller Changes 9c I have written some animation classes in C#. I did overide some objects in the process and found that 2 changes had come into effect in 9c that were different in 9b. One being that a method had moved from Directx.Direct3D to Directx. Also there was an error with GetAnimationSet in 9a that caused everyone to use GetAnimationTrackSet, that has been changed now, so GetAnimationSet is the one to use agian. Also one property became an array. I know this is a little hairy fairy, but it took about 30 minutes to work it out.
  2. 3D Max Problems All the animation exporters are based on the DirectX SDK Extras Download xexporter. They use Physic not Skin to access the animation information. I had many errors thrown from it trying to access the information, causing Max to come to it's knees and crash. I spent alot of time trying to make it work and used many exporters. In the end I moved to Maya, which has a much better animation engine. I used a program called deep exploration to change the max files into maya, animated them in no time and exported them no problems as .x files. Look for a post called Maya Problems for more info... I got multianimation sets and many models working in C# along time ago, all thanks to Maya and a Japanesse Guy. My advice, forget Max, get Maya.
  3. BETTER EXPORTER I tried the link that I posted and it didn't work on my friends copy of Maya 5 but I found one that did .... Maya 4.5 and 5 x file exporter you can thank a guy named John McClelland for this one
  4. I would try creating a buffer to store the information comming in from your stream then feed it into the from stream option.
  5. Well I glad that I was of dome help :D
  6. COMPILED PLUG-IN I found a compiled one for maya 5 ... MAYA 5 X EXPOTER PLUG-IN I haven't tried it myself, but should be cool, last updated 19 Janurary I found this on the web the other day also .... it's the source cood to a managed directx book .... lots of good C# examples ... who knows maybe someone will even buy the book. C# Code MSI installer
  7. NOT FOR DUMMIES The truth is that the concepts involved in 3d programming at a comercial level are so complex that you have to be a very smart to even consider programming in 3d in the first place. I look at managed directx as a quick easy place to laern about the Directx API, but a game written in VB or C# will never be able to run on an XBOX or PS2 like a C++ one would. Almost all professional games are written in C++ and there is so much documentation and books on the subject that it is very posible, if you know C++ and top level maths and 3d theroy to be able to use it succefully. Microsoft know that serious game programmers write there games in C++ so the can be easily ported to multi platforms. As for a conspiricy to stop home users from competing with comercial gaming houses .... my friend who works for Atari in says that an average big game title has 150 highly skilled animaters, world builders, designs, story boarders, programmers and cut sequence people, ... etc. working for around 18 months to create one title that you would recognise. That means a total cost of US$5,000,000 or 430,000 man hours. So for one man thats about 11,000 weeks work or more to the point 211 years. I know ever since window 95-98 everyone has bashed microsoft and has great conspiracy theories about them, but hey they do give alot of stuff away for free and thanks to them I have written cool text to speech stuff, GIS stuff and 3D stuff for the cost of a development studio.
  8. have a look at http://www.boujou.com/
  9. just a thought, have you got the ZBuffer enabled? device.RenderState.ZBufferEnable = true; the zbuffer contains the flip screens pixels with a depth number ( z ) assigned to every pixel so as to draw layer apon layer while taking care of the problem of drawing with depth.
  10. At a quick glance .... you have choosen vertex type of PositionColoredTextured That means every vertex has an x,y and z postion in 3d space and little subtriangles make the object up from that. Also the vertex has a color, which I haven't seen being set anywhere ( only a quick glance ). Also and most important is that a texture is mapped onto the object using UV. UV work like x and y, a total area of a texture is 1.0f ( 1 in a float value ) so if you use 50.0f in both U and V the texture would tile 50 times. as your no using color, maybe use PositionTextured The big missing peice is when you render the scene you are not setting the render state to be using your texture that is referenced in the Vertex objects before drawing your primate object. You set this in the initalize objects, but it's not really the right place for it. in C# it would look something like this device.SetTexture(0,texture); device.TextureState[0].ColorOperation = TextureOperation.Modulate; device.TextureState[0].ColorArgument1 = TextureArgument.TextureColor; device.TextureState[0].ColorArgument2 = TextureArgument.Diffuse; device.TextureState[0].AlphaOperation = TextureOperation.Disable; remember that directx is a state machine, so you set and change the render state as you draw stuff. also when using the z axis you should turn on the z buffer in Initalization device.RenderState.ZBufferEnable = true; I don't know if this is a VB / C# difference, but when you create a vertex buffer for the primate object you usual have an event handler that is called when the device has finished creating the vertex buffer, after which time you then fill the vertex information. hope this helps. :)
  11. did you compile the plug-in yourself? On another topic ... I have written a C# version of Multianimation and have succesfully exported mesh files and textures from Max 6 no problems. But I have not been able to get the animations to export as desired. I have been using Max for a long time and tried exporting the tutorial examples ( 6 different files ) and none of them worked properly either .... some did move, but not as they did in Max. Also similar results with the very good Panda exporter. I can find no tutorial or documentation on how to make this work. After posting at new.microsoft.com.programming.manageddirectx no-one answered and within a week the post eventually was deleated. As you could imagine, having written a working animation controller and being able to make excellent models that are animated, missing that middle piece is REALLY frustrating. :mad: Has anyone had luck with Maya ..... Does anyone want to trade the code for a tutorial on how to make the animation export from Max? :(
  12. YOUR VERY WELCOME :)
  13. DXSDK SUMMER UPDATE EXTRAS you need a little download called DXSDK SUMMER UPDATE EXTRAS Microsoft SDK Extras It is a self-extracting zip exe. Unzip it into a folder then you will find a maya folder for many different versions i.e. \DXSDK EXTRAS\Direct3D\Plug-Ins\Maya version 4.0 and 5.0 I use Max 6 myself ... what I had to do was load the C++ source code then include the path to the MAX SDK and compile the project then copy the resulting plug-in file to the plug-in directory in MAX. I believe the process is the same for Maya. QUOTE .... ====================== MAYA X-FILE EXPORTER ====================== Installation ------------ 1] Make sure that Maya is not running 2] Copy "xExport.mll" to "<mayapathname>\bin\plug-ins" 3] Copy "xfileTranslatorOpts.mel" to "<mayapathname>\scripts\others" 4] Copy "bicubicBezierPatches.mel" to "<mayapathname>\scripts\others" 5] Run Maya 6] Select "Window->General Editors->Plug-in Manager" from the main menu bar 7] Turn on the "auto load" checkbox next to "xExport.mll" 8] Turn on the "loaded" checkbox next to "xExport.mll" Usage ----- 1] Select "File->Export All" from the main menu bar 2] Select "XFile (*.*)" from the "File of type" drop-down menu 3] Select a file name from the browse window 4] Click the "Export" button -OR- Click the "Options..." button for further options (recommended) ;)
  14. MESH VERTEX INFORMATION here is some information as to how to get vertex information from a BOX MESH in C#. // Load the mesh from the specified file mesh = Mesh.Box( dev, 10.0f, 5.0f, 15.0f ); Microsoft.DirectX.Direct3D.VertexElement[] mMeshVertexList = mesh.Declaration; int mVertexCount = mesh.NumberVertices; // Texture[] meshTextures = new Texture[mVertexCount]; for( int i=0; i<mVertexCount; i++ ) { Microsoft.DirectX.Direct3D.VertexElement mVertexSingleElement = mMeshVertexList[i]; } I will do a full example at some stage.
  15. SUPPORTED FORMATS DirectX does not support gif files, it supports ... PNG BMP DDS DIG PPM TGA so I would use PNG instead forexample. What your trying to do is done using textures, there is a working example in the DirectX Sample Browser that gets installed with the SDK
  16. igotjunk

    Matrices etc

    LOOKS REALLY GOOD Thanks for that, it looks really good.
  17. igotjunk

    Matrices etc

    BOUNDING SPHERES I've never used it, but this compiles in C# ... I only breifly looked into it for you but I think this should help unfreeze the works a bit. C# // Should be set be the CalculateBoungingSphere command Microsoft.DirectX.Vector3 returnCenter; Microsoft.DirectX.Direct3D.Frame myFrame = new Microsoft.DirectX.Direct3D.Frame(); // myFrame.MeshContainer = // your mesh here maybe ????? float boundingRadius = Microsoft.DirectX.Direct3D.Frame.CalculateBoundingSphere( myFrame, out returnCenter ); I would love to see the Camera example ... I had been using trignometry to change the camDes and alsorts ... I realise now that most people use an inverse matrix. But I've only been doing Direct X for a week now, so slap me. :)
  18. WELL DONE All good for some light game play entertainment ... my day feels somewhat better.
  19. igotjunk

    Matrices etc

    TEAPOTS IN THE MIST Here is a little helper to create a grid of teapots that I wrote in C# first create a little class to contain an array of MESH teapots. class myMeshes { public Mesh theMesh; public int index; } then in the Initalisation ( InitializeDeviceObjects() ) int numberOfMesh = 25; meshList = new myMeshes[numberOfMesh]; for( int i=0; i<numberOfMesh; i++ ) { meshList[i] = new myMeshes(); meshList[i].index = i; meshList[i].theMesh = Mesh.Teapot(device); } then render the array of Mesh Objects // Render the teapots for( int iObject=0; iObject<meshList.Length; iObject++ ) { device.Transform.World = Microsoft.DirectX.Matrix.Translation( (float)((iObject%5 ) * 3 ), 0.0f, (float)((iObject/5 ) * 3.0f ) ); meshList[iObject].theMesh.DrawSubset(0); } don't forget to declare the globals private myMeshes[] meshList; :)
  20. igotjunk

    Matrices etc

    There is a thing in DirectX and all 3d Programs called UNIT, it is the eqivilant to a map scale. When you create your model it is usually exported in unit scale, so if you create all your models yourself, this shouldn't be a problem. As Floating point numbers are used the math can cause slight variances in results depending on how higher range you have used in your floating point, so the NORMALIZE funtion is used to compute to the nearest UNIT. As for the Math, 3D is basically an excercise in Math ... MATRIX, POINT, GEOMETRY and TRIGNOMETRY. So learning the math is very important. MSDN has an introduction to the theory of the math. Microsoft 3D Introduction A distance from the center point in a matrix is called the magnitude ( or length of a vector ). This is known as Pythagorean thoery. The short hand notation for magnitude of a vector ( how long is the distance from the center in 3d space ) is ||v||. 3D maffs is no trip to the beach, but is very nessasry if you plan to do anything worth anything. :confused:
  21. ANIMATION TYPES There are 2 main types of animation shown in the SDK, TWEEN used in the Dolphin and BONE HIERARCY like in the tiny.x model. The standard for serious animation is to use BONE animation ... If you've never creatred a model, it works like this. you create a mesh shape. Add a outer texture UVW Map of a bitmap for example to create the clothes, face, etc. put a skeleton inside, that has a relationship to all the other bones, usually haing the hip as the main starting point. Then you skin the model, which is a proccess to assign which VERTICES/FACES ( little triangle faces that move when the bones do ) are associated to what bones. You move the bones around over a time line creating key fame points in animation. The total animation is then merged and named. Multipul animations can also be added. This information is saved in the text of the \DX90SDK\Samples\C++\Direct3D\MultiAnimation\tiny_4anim.x file in the SDK. Try loading it into the mesh viewer and choose between animations. Creating an Instance of tiny_4anim.x is no so easy. There is an Animation Controller to change between animations, a frame controller for the animation, a mesh blending index controller and a bones object to address.
  22. PIXEL FOG :eek: Using C# you can't call SetRenderState, you have to address the properties instead ... silly me. This code worked. device.RenderState.FogEnable = true; device.RenderState.FogTableMode = Direct3D.FogMode.Linear; device.RenderState.FogStart = 60.0f; device.RenderState.FogEnd = 150.0f; device.RenderState.FogDensity = 0.0001f; device.RenderState.FogColor = System.Drawing.Color.Blue;
  23. PORTAL MAPS Turning off CULL MODE not nessasarily a good idea. CULL is also responsible for back face culling, or not drawing the stuff you don't see, and would slow down a gaming engine using alot of models, from what I have read. I have set the near and far planes ( that's the projection mentioned in the first post ). The titled cube mesh I created is huge in unit size, without a large far plane it is only part visable. I believe that PORTAL MAPS and FOG are the ones for me. There are 2 types of FOG in Directx Vertex and Pixel. Vertex done by Directx in CPU space and Pixel by the Graphics Card. So I choose pixel. So I have to set the render state for fog. Something like this ... Device.SetRenderState(D3DRS_FOGENABLE, bTRUE); Device.SetRenderState(D3DRS_FOGCOLOR, Color); But there lies my problem ... (85): 'Microsoft.DirectX.Direct3D.Device.SetRenderState(int, float)' is inaccessible due to its protection level :-\
  24. Hi, I have just started programming DirextX in C#. I have a question about the basics. I have created a simplke cube mesh in Max 6 then exported the mesh with texture into a file named cube.x Tutorial Here Then I loaded the mesh into my app. I have rotated and zoomed around the object no problem. Also using standard mesh objects I have created other cubes etc. in myproject. I have been having a blast. World ... location for placing objects. View ( or camera ) ... location of you viewing projection ... Field of View, aspect of ratio, start view point on z axis, end view point z axis One Question though is that after the end view point of the projection goes out of range, it cuts my mesh off into blue space .... anyone know anything about envoirnment mapping or volume fog? :D
×
×
  • Create New...