Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

199 Neutral

About ReaVeR-Andrey

  • Rank
  1. ReaVeR-Andrey

    Local transformations

    You can set one transform, render one sphere, set another transform, render another sphere. There's a good object that makes the matrix stack for you.
  2. ReaVeR-Andrey

    'DrawText' on top of sprite

    First, check the z-buffer (it actually should not affect anything as the sprite does not use it). Then, use D3DXSprite::End () (or whatever it is) before using other drawing function (well, in this case maybe you could just pass the sprite pointer as the first parameter to DrawTextA (i think it is)) because when you do this, the sprite sorts and draws anything you passed to it earlier, so the text gets overlapped if you do this after calling DrawText.
  3. ReaVeR-Andrey

    Mesh.Intersect not outputting expected values

    I didnt say that. I just thought you used the name "to" because its the endpoint. I dont know how the C# SDK works so you'd better read it. But probably its actually the endpoint because its what the C++ SDK usually asks for.
  4. ReaVeR-Andrey

    DirectX draw simple 2D shapes inside a Sprite (C#)

    Why would you want sprites for basic 2D objects? You just have to set the vertex format to XYZ/rhw (and vertex structure too), and supply x/y coordinates, leaving z blank. You also have to disable z-buffer, lighting and such. Lines and polygons are drawn with Draw..Primitive methods, but circles aren't supported directly, so you'll probably just have to use 16-32 lines to form it ({cos(A);sin(A)} for 32 As in the range of 0..2*PI). If you want it to be stored in a texture after that, you can create a D3DXRenderToTexture object which is described in SDK and is relatively simple. I can drop the code if you have problems, but it is in C++.
  5. ReaVeR-Andrey

    Loading objects

    window.LoadMesh("C:/Documents and Settings/Kenny/My Documents/Visual Studio 2005/Projects/DirectX Practice/DirectX Practice/bin/Debug"); Where's the filename? Surely it ought to be ".../Debug/pond.x" or something like that? I'm not familiar with C# SDK and it seems to differ from C++ one, so I cannot give help beyond that.
  6. ReaVeR-Andrey

    Mesh.Intersect not outputting expected values

    Hey, it is not "from + (to * dist)", it is "from + (dir * dist)", where dir is (to - from). So you do something like retVal = Vector3.Add (from, (Vector3.Multiply (Vector3.Subtract(to, from), info.Dist)));
  7. ReaVeR-Andrey

    Expression simplification

    Thanx for the methods, I will try to implement the one with negative exponents. The problem is, if I have a list of factors (with powers), do I check every pair of them (whatever, I do not care about speed too much) for equality? I've already implemented a procedure that breaks down the string into objects (like expression, term, factor), but now I realize I don't have to make separate objects for +/-, */div, .., it just replicated the recursive process of parsing expressions. The recursive tree method is way simpler to work with, now I come to think of it. I also have a process that eliminates expressions independent of the argument. Basically I want to be able to differentiate expressions symbolically, but I don't want to get d(x*x/x)/dx = ((1*x+1*x)*x-1*(x*x))/x/x. There's also a question about efficient 2D equation solving. You get an expression with x and y parameters (e.g. "x^2+y^2-9"=0) and have to draw it. I broke down the window into 16x16 rectangles and check a few points in it for sign. If it varies, I check every pixel of the rectangle and draw them if the sign changes in them (first in xy order, then in yx order). It works, but it does take considerable time do draw every frame (so if I try do drag the picture it gives out something like 1 fps). Is there a more efficient method for doing this? And, there's a part about factorizing expressions in numerator/denominator that might be simplified. What is the simplest way to factorize expressions for this? By the way, the expressions may also consist of sines/cosines/other functions as well. [Edited by - ReaVeR-Andrey on May 20, 2007 11:33:52 AM]
  8. I have a math expression, given in a string (e.g. "x*x/(x-1)+2") that is a function of x and maybe other variables. I want to write a program that simplifies it, for example convert 1*(x-1*0)/x to 1.
  9. vertex shaders are one way. you do something like (in asm shaders): mul oT0.xy, v0.xy, c4.xy DX may require to break this code into couple of lines, depending on the version. you can also use matrices.
  10. ReaVeR-Andrey

    Drawing primitives on surfaces

    The DrawPrimitive method draws on a surface you used IDirect3DDevice9::BeginScene method. To draw on a user-defined surface you need to create, say, ID3DXRenderToTexture (or something like that, I don't have the SDK nearby, so I don't remember how to render onto a surface) and call something like ID3DXRenderToSurface::BeginScene (again, I don't remember the names) and draw. Don't forget a) ID3DXRenderToSurface::EndScene, b) These calls have to be outside IDirect3DDevice9::BeginScene and EndScene calls. Hope this Helps =)
  11. Oh thanks a lot. BTW i use 5th max at home do you have an exporter for it? .. and where do you get an MD3 importer for max? =)
  12. Where do you get an exporter for 3DSMax 8 that can export to X files. I have panda for my 5th max, but my friend has max 8.. The exporter that comes with some SDK (i think june 2005) has an exporter for max 7, but it doesn't work in max 8. Is there an appropriate exporter in later SDK versions, or, even better, can i download a decent one without getting the entire SDK?
  13. maybe you didn't clear some buffer, like depth buffer or color buffer or stencil buffer (if you use it). the buffer doesn't clear if you restart your application or create a new device.
  14. It will produce some results, but I'm not sure it'll be exactly correct (only you'd better use the sum).. I guess what you need is to apply a smaller bumpmap to a larger one. For instance let's say A is the normal vector gained from the first lightmap, and B is the normal vector from the second lightmap. Then you get the basis from A (assume y axis points outward from the texture, x points right and z points up): {A^Z, A, X^A}= , where ^ stands for cross product {<A.y,-A.x,0>, A, <0,-A.z,A.y>}, which is a set of three vectors. Then you should normalize these vectors (you get {P,A,Q}), and the resulting vector will be: P*B.x+A*B.y+Q*B.z I think implementing this will kill the videocard, but you can precompute P and Q and store them in another texture (however, 4 textures this may also kill the videocard =) EDIT: You can also compute colors gained from different lightmaps and then multiply them (or take the average)
  15. ReaVeR-Andrey

    Post Processing in Directx

    you can, but no one guarantees that the results will be appropriate. for instance, you add glow to A, then draw B which is behind A, but B covers the glow. You may try playing with the stencil buffer to add glow only to A.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!