Swamii

Members
  • Content count

    48
  • Joined

  • Last visited

Community Reputation

150 Neutral

About Swamii

  • Rank
    Member
  1. Hi guys, I just installed the DirectX October SDK, which includes the beta MDX assemblies for .NET 2.0. Has anyone played with this? I am amazed at the amount of churn they've done, ripping out all sorts of APIs, replacing or renaming others without warning...yikes. One question I have: what happened to lights? You used to be able to specify the type of light when you create one: directional light, spot light, point light, etc. But now, the LightType enum is ...empty. The constructor for Light doesn't take any parameters, and I don't see any way to change the actual type of light. The only thing I see is light.LightType, which can be set to an LightType enum constant, however, the LightType enum is empty!
  2. Care to elaborate? I've been told the MatrixStack class is what I need, and it indeed seems to do the appropriate transformations, but I don't know how to get the model's position after the transformation. After arm is rotated, how do I get the position of the hand?
  3. I store the position of my models as variables, then render that model using that stored position: class Model { private Vector3 position; ... void Render() { device.Transform.World = Matrix.Translation(position); } } That works just fine, until I start having model hierarchies. For example, I have a 2 models: arm and hand. Arm is the parent, hand is the child. Whenever arm moves, the hand should move along with it. MY QUESTION IS: if I rotate my arm, how do I find out where the hand's position is?
  4. [.net] .NET message loop

    Check out the Managed DirectX 9 creator's latest post on render loops: clickity. Hint: Invalidate and DoEvents both have a lot of overhead, affecting both memory and performance.
  5. Thought you all might be interested to know, coming in from the ZBuffer, Microsoft announced some new information regarding DirectX 10 today at the PDC: This will just be a quick summary of some of the points from the 2 DirectX talks they had at PDC. They were well attended - the first one had to have an overflow room. DirectX 10 is the name of the game, they didn't mention WGF once. Vista will ship with both DirectX 9 (which contains all the backward compatible stuff (dx8,7,6, direct draw etc) and DirectX10 which REQUIRES DX10 hardware (non exists yet) and will not be backward compatible. The DX9 implementation will run all the old programs with no code changes. This is quite amazing considering that in Vista programs have to share the graphics card with the OS. There will be some extensions to DX9 that you can take advantage of in Vista. If your graphics card is using the new Vista driver model then GDI/GDI+ has *NO* hardware acceleration. In practise this shouldn't be a big deal since the CPUs are so darn fast these days. No more managing the memory yourself and worrying about when to create things. Memory is now shared and the OS decides when to page things up to the graphics card. No more DeviceLost (Yay). In fact the only time you can lose the device is if someone pulls the card or the drivers get updated. Generally only things that long running apps (like VISTA) have to worry about. [and those of you wondering how you can unplug a card need to think about laptops that have an auxiliary graphics card in the docking station] Can't interleave GDI and DX on the same surface any more. DX10 supports some new pipeline features: Geometry Shader: Runs after the vertex shader. Has visibility to the entire data stream including adjacency etc. Can add ro remove data from the stream meaning that you can create geometry on the fly. They had a cool demo of a particle system running totally on the GPU and a scene that had dynamically growing vines, also 100% on the GPU Input Streams: This is a way of piping data out of one stage and back into earlier stages next time though. Essential for these totally 100% on the GPU programs. The CPU never has to modify the data. Predicated Rendering: Based on a decision earlier in the shader pipeline you can decide not to do something later. The example they showed was to render the bounding box around a complex object and then check if the box was occluded. If it was then the complex mesh also must be occluded so it is never ever passed through the pipeline. On a totally different note, while you're at it, check out this great little gem, written by 1 guy for his girlfriend, using C# & Managed DirectX 9: Super Mario clone.
  6. It is an excellent find. I'm truely astonished at how well written and apparently polished this game is. A testament to how reliable and easy-to-use MDX reall is; a single person created a really, really fun game. My 5 year old is loving it too. :-)
  7. Hey guys Thought you all might enjoy this, saw it on Tom Miller's blog. A Super Mario clone written in C# using Managed DirectX 9. Check it out here.
  8. I think you misunderstand my problem. I know how to rotate my objects, as well as position them. My problem is, once I've rotated my object, how do I find its new position? Take the following code for instance: // Position my model and rotate it. int modelPositionX = 10, modelPositionY = 20, modelPositionZ = 30; device.Transform.World = Matrix.Translation(modelPositionX, modelPositionY, modelPositionZ) * Matrix.RotationAxis(...); // Now that I've positioned and rotated my model, how do I find out its new position? modelPositionX = ??????; modelPositionY = ??????; modelPositionZ = ??????; I've the gut feeling I'm approaching this totally wrong. How do you all position your objects? How do you know where to draw them after rotating them about an external axis point?
  9. My little pet project is a Managed DirectX 9-based engine. I'm quite the newbie when it comes to dealing with DirectX directly; this is one of those cases that must have an obvious answer. Let's say I have a model that is rendered like so: int modelPositionX, modelPositionY, modelPositionZ; ... device.Transform.World = Matrix.Translation(modelPositionX, modelPositionY, modelPositionZ); Now, let's say I apply a Matrix.RotationAxis to the Matrix.Translation. If I were to do that, how would I now retrieve the new "position" of the camera? Since the RotationAxis may change exactly where the model is drawn (changing its "position" in 3d space), how would I determine where the new position of the model is? Or, as a newbie, am I approaching this in the wrong way?
  10. Unity questions about mfc

    Don't tell me to use .NET then why are you asking in the .NET forum?
  11. That works! Thanks guys for helping me solve these problems, I appreciate it.
  12. Ok, I've added the following lines to my code before creation of the device. presentParams.AutoDepthStencilFormat = DepthFormat.D16; presentParams.EnableAutoDepthFormatStencil = true; With only those modifications, my models now look totally screwed! :-p Have a look, rendering the same model as shown above, I get the following: Any ideas what could be wrong now? Cull modes, depth testing, or anything?
  13. Excellent, I'll try this out soon as I get home from work. Thanks guys!
  14. Can you explain that a bit further? What do I need to do to get depth buffering working correctly? Currently, I just draw all models in the scene, not in any particular order...