Jump to content
Xtreme .Net Talk

Kavan

Avatar/Signature
  • Posts

    71
  • Joined

  • Last visited

Everything posted by Kavan

  1. Instead of using Compare.Always just use Compare.Equal.
  2. If I remember managed C++ does not support properties. You'd have to access properties by their accessor methods like: x->set_Item(0, value); x->get_Item(0);
  3. I'm guessing here, but I think the problem is in one of the following lines: d3d.Dev.RenderState.ReferenceAlpha = Color.Black.ToArgb(); d3d.Dev.RenderState.AlphaFunction = Compare.NotEqual; d3d.Dev.RenderState.ColorVertex = true;
  4. This might sound dumb, but are you setting the texture? Some code would probably clear things a bit.
  5. As far as I know you cannot export splines in x files. At lest not without custom templates, which means that you'd have to extend the format. For drawing lines I suggest you use the Line class as this is the easiest way to draw (poly)lines with varying widths.
  6. If you expose directx objects to the user then he also needs reference to directx. if it's behind the scenes then they don't have to.
  7. Ok, but the main part is done using Unproject. I guess this one uses the currently set world matrix. You could use Vector3.Unproject to get the same result without setting world matrix.
  8. It just seems so. In fact the main part is done in D3d. I'm not sure what that is, but it looks like some library (not MDX).
  9. Lights are not transformed = they are in world space Mesh.Intersect does not know of transformations = it works in model space
  10. Check http://www.lightlink.com/tjweber/StripWav/WAVE.html if it's of any help to you.
  11. Are DirectX samples working for the guy that installed DX 9 SDK?
  12. You'll have to do it "by hand", there's no built in function to save wav files.
  13. If you have a program that will generate mesh for you then that is probably the easiest way. If you'll need more advanced algorithms then you should look at http://www.vterrain.org.
  14. Take a look at the billboarding sample in the SDK. That should give you some basic ideas to get you started.
  15. Only limited amount of things can make it to the mdx. They have troubles just covering the things that are already in dx. Here's an idea: create the function yourself and make it available to the public.
  16. It looks like you're in need of a course in linear algebra. What does it have to do with your problem? Mesh.Intersect takes start of the ray and ray direction as its parameters. You only have start of the ray and another point on the ray. So you have to compute ray direction. You do this with Vector.Subtract. Of course you can always just take (0,-1,0) for your ray direction if I understand how you want to use it.
  17. It's Mesh.Intersect(rayStart, rayDirection). So your one should be like platform.intersect(car.position,vector3.subtract(belowthecar.position,car.position))
  18. Try this: (meshVertex[])(meshc.LockVertexBuffer(typeof(meshVertex), LockFlags.None, meshc.NumberVertices));
  19. When using mesh.intersect try to imagine it as a line test against a mesh. So you can have your ray start anywhere you want. It is usually used to test if a mouse is over a mesh. Your mouse defines the ray and you're interested if the ray intersects the mesh. You could also use it for other purposes like collision detection but have in mind that it's performance is not very good. So it will only be good for very small games, otherwise try to get some other technique for collision detection.
  20. Ok then you can't use your setupmatrix as you have it now. To set up world matrix for the car you do something like this: World = Matrix.Translation(CarPosition) You could also do it like this if you'd like it to be rotated: World = Matrix.Multiply(Matrix.RotationY(AngleInRadians), Matrix.Translation(CarPosition)) If you'll do collision detection like you said then you don't have to set world matrix. Just make sure that your car's position and below car are correct (meaning they are in world space coordinates).
  21. I don't think I understand you. What does your setupworld do? how do you perform collision tests? You definitely want to set world matrix for the car. And I don't understand what you mean by moving the platform while moving the car. Why don't you have platform at fixed location. I'd do things like this: View = CameraViewMatrix World = Identity Platform.Render World = CarMatrix Car.Render I skipped the collision as I don't know in what way you're doing it.
  22. I would have the platform fixed (always identity) and would only scroll the car. For the camera I'd calculate it's position to be somewhat behind and above the car and have the lookat vector at the position of the car.
  23. You've got things wrong. You can't change the view after you render things. The view must be correct during the rendering. After it's there it's there. Also don't think in terms that each object has it's own camera. Objects only have position and orientation which is encoded in a matrix or vector (translation) + quaternion (rotation). You set this by setting the world matrix. You only have one camera at a time. You could have more of them for different views, but you can only use one at a time. You set this matrix with LookAtLH for example and set it for the view matrix. I hope this clears things up a bit.
  24. I think there is nothing wrong with checking it each time.
  25. Come on. We're measuring speeds of computers in GHz nowadays. That's billions of boolean checks in a second. FOO: Just throw it through a profiler, that's the most reliable way to find out what's blocking your performance.
×
×
  • Create New...