Advertisement Jump to content
  • Advertisement

ouraqt

Member
  • Content Count

    206
  • Joined

  • Last visited

Community Reputation

236 Neutral

About ouraqt

  • Rank
    Member
  1. I always choose "Empty Project" in Visual Studio. Then it decides automatically whether to create a console window based on whether you have a main or a WinMain. Also it doesn't add any MFC, AFX, or any of that Microsoft weirdness to your project.
  2. ouraqt

    Merging 2 video files?

    You could also write a simple C++ application to do this for you (shouldn't take more than a few minutes). Use OpenCV to read and write the videos. It's free and you might learn a little doing it.
  3. I would suggest drawing polygons that are more than 1px wide. A thick line is really just a rectangle. Plus, if you have anti-aliasing on in general, it should give you anti-aliased lines, too, when they are composed of polygons. Additionally, I believe you can send it line data (2 points) and have the geometry shader form the polygons you need. What version of Direct3D are you using? Edit: Aw, beat me to it.
  4. Small buffers - got it. But I'm also trying to do an FFT on the data - and from my knowledge of FFTs, larger buffers give more accurate fourier transforms. I'm trying to determine the fundamental pitch of the mic input in real time - I guess the problem is using a small buffer size with FFTs doesn't work very well. Hmmm...I wonder how autotune does it.
  5. I am running Windows 7, 64-bit, programming in C++. I want to feed audio input from a microphone to the speakers in real time. I tried using the Win32 WaveIn and WaveOut APIs, but the latency was much to large (as in, > 800 ms). What is the smallest delay I can expect to achieve, and what audio library would allow me to do so? I am looking into OpenAL (and considering FMOD as well?). DirectSound also sounds promising, but it is technically deprecated and being phased out, it seems. Audacity seems to do a fairly decent job at software playthrough (you can enable it in the preferences). I want to achieve at least that level of performance.
  6. I'm working on an application that will allow users to digitally sculpt into a triangle mesh. Rendering is done in OpenGL. The basic concept is that users can sculpt into a mesh with a pillbox-shaped tool (a pillbox is a cylinder with half-spheres at the ends - it can also be thought of as a line segment with thickness radius r). The way the user moves this virtual tool around in space is irrelevant. But any time the tool intersects with the mesh, it should basically "subtract" away that intersecting portion. What is the best way to do this? My first approach was to simply move the vertices until they are no longer intersecting the mesh, but this doesn't account for when the tool goes all the way through the mesh to make a "hole" in the solid. How do I handle this? I was thinking of some method that never moves vertices around, but instead deletes the intersecting triangles/vertices and generates new ones around the boundary region. Is this a good approach? Thanks!
  7. Wait, so DirectX 11 works on DirectX 9 level hardware, but DirectX 10 doesn't?
  8. ouraqt

    make a matrix not modify a coordinate

    I'm not sure what you mean. You mean like expanding it out to see all the dot products? I have looked at an expansion of matrix multiplication before. I can't seem to figure it out. I'm tempted to just write a vertex shader that sets the w component back to what it was before the transformation. Is this a good solution?
  9. ouraqt

    make a matrix not modify a coordinate

    Indeed, I know how matrix multiplication works. But I can't just make that row (0, 0, 0, 1). That would affect the other coordinates, wouldn't it? I'm pretty sure it would.
  10. Don't worry. You won't have to debug my code. But in case you're curious... // compute a homography matrix matrix math::matrix_homography( float src_x0, float src_y0, float src_x1, float src_y1, float src_x2, float src_y2, float src_x3, float src_y3, float dst_x0, float dst_y0, float dst_x1, float dst_y1, float dst_x2, float dst_y2, float dst_x3, float dst_y3) { float dx1, dy1, dx2, dy2, sx, sy, g, h, a, b, c, d, e, f; // quad to square dx1 = src_x1-src_x2; dy1 = src_y1-src_y2; dx2 = src_x3-src_x2; dy2 = src_y3-src_y2; sx = src_x0-src_x1+src_x2-src_x3; sy = src_y0-src_y1+src_y2-src_y3; g = (sx*dy2-dx2*sy)/(dx1*dy2-dx2*dy1); h = (dx1*sy-sx*dy1)/(dx1*dy2-dx2*dy1); a = src_x1-src_x0+g*src_x1; b = src_x3-src_x0+h*src_x3; c = src_x0; d = src_y1-src_y0+g*src_y1; e = src_y3-src_y0+h*src_y3; f = src_y0; matrix quad_to_square_inv; quad_to_square_inv.m[0][0] = a; quad_to_square_inv.m[0][1] = d; quad_to_square_inv.m[0][2] = 0.0f; quad_to_square_inv.m[0][3] = g; quad_to_square_inv.m[1][0] = b; quad_to_square_inv.m[1][1] = e; quad_to_square_inv.m[1][2] = 0.0f; quad_to_square_inv.m[1][3] = h; quad_to_square_inv.m[2][0] = 0.0f; quad_to_square_inv.m[2][1] = 0.0f; quad_to_square_inv.m[2][2] = 1.0f; quad_to_square_inv.m[2][3] = 0.0f; quad_to_square_inv.m[3][0] = c; quad_to_square_inv.m[3][1] = f; quad_to_square_inv.m[3][2] = 0.0f; quad_to_square_inv.m[3][3] = 1.0f; matrix quad_to_square = matrix_invert(&quad_to_square_inv); // square to quad dx1 = dst_x1-dst_x2; dy1 = dst_y1-dst_y2; dx2 = dst_x3-dst_x2; dy2 = dst_y3-dst_y2; sx = dst_x0-dst_x1+dst_x2-dst_x3; sy = dst_y0-dst_y1+dst_y2-dst_y3; g = (sx*dy2-dx2*sy)/(dx1*dy2-dx2*dy1); h = (dx1*sy-sx*dy1)/(dx1*dy2-dx2*dy1); a = dst_x1-dst_x0+g*dst_x1; b = dst_x3-dst_x0+h*dst_x3; c = dst_x0; d = dst_y1-dst_y0+g*dst_y1; e = dst_y3-dst_y0+h*dst_y3; f = dst_y0; matrix square_to_quad; square_to_quad.m[0][0] = a; square_to_quad.m[0][1] = d; square_to_quad.m[0][2] = 0.0f; square_to_quad.m[0][3] = g; square_to_quad.m[1][0] = b; square_to_quad.m[1][1] = e; square_to_quad.m[1][2] = 0.0f; square_to_quad.m[1][3] = h; square_to_quad.m[2][0] = 0.0f; square_to_quad.m[2][1] = 0.0f; square_to_quad.m[2][2] = 1.0f; square_to_quad.m[2][3] = 0.0f; square_to_quad.m[3][0] = c; square_to_quad.m[3][1] = f; square_to_quad.m[3][2] = 0.0f; square_to_quad.m[3][3] = 1.0f; return quad_to_square*square_to_quad; } ...and I'm applying this matrix to the vertices (x, y, z, w) in screen space. The problem is that this matrix modifies the w component of the vertex, which normally isn't a problem because we only really care about x and y (and z, because it is used for perspective projections). BUT OpenGL does care. It uses the w component to compute depth and, therefore, clipping. When I apply a homography matrix to the screen-space vertices, it causes triangles to be unnecessarily clipped (depending on my view angle etc.). Is there any way to take this matrix, and make it leave the w coordinate alone?
  11. ouraqt

    surface normals

    Another way to do it would be to cast a ray from the center (well, the center isn't particularly important, but it gives you a starting point) of every polygon out to infinity in any direction. Count the number of OTHER polygons it hits. If it hits an even number of polygons, the normal should be in on the same side of the polygon as the ray. This only works for closed surfaces.
  12. ouraqt

    freeware calculator

    I don't think this is exactly what you're looking for but... I made a calculator that opens REALLY fast (so that's at least one thing you wanted). It basically just evaluates any expression you type into it, and it graphs and does calculus too. Get it here if you're interested. It allows you to create variables, but it doesn't save them upon exit. Also, the number formatting isn't "nice" - numbers usually have trailing zeroes after the decimal point. Anyway, I use it all the time for quick calculations. I find it to be quite handy.
  13. ouraqt

    Video Decoding

    However, I was under the impression that DirectShow is a deprecated API and Microsoft plans to replace it soon. While I do not need speed per se, I am looking for a moderately robust solution (i.e. actively maintained library). I suppose using something like DirectShow wouldn't be so bad. Can I extract the pixel data from DirectShow directly, without drawing it on the screen or anything? Quote:In _fastcall's defence, you did state that the decoding process can be relatively slow (not real-time), so the easiest method might be to use a pre-existing tool to dump the frames to images (in some easy to read format like BMP or a raw format of some kind), and then load the images up in your code. Of course this isn't as pretty as using a library directly, but if you're just experimenting or playing around, and don't need to worry about distribution/other users so much, it might be worth considering. Oh, I see. I am trying to make a reusable tool that perhaps others will use as well (although, I am mostly designing it for myself). Additionally, I think writing all the frames to bitmaps in a folder for a video even only a few minutes long would take a horrendous amount of disk space. This may not be a huge problem because these are only temporary files.
  14. ouraqt

    Video Decoding

    _fastcall, I'm looking for a library, not a piece of software. And I'm not in the mood to digest a whole open source application at the moment. I have a feeling a simple library should be able to do this for me. Thanks tho! mattd, that seems to be more like what I'm looking for. I'll check it out.
  15. Hey everyone! I'm looking for a [free] C/C++ library that decodes video files in common formats (preferably at least MPEGs). And by "decode", I just mean I want the ability to get the bitmap data for each frame (so I can save each frame to a file as a separate image, for example, or manipulate it somehow). I don't need to write any video data, just read it. It doesn't really need to be fast or anything (the decoding won't be happening in real time). The library shouldn't output the frames to a window or anything - I just want the bitmap data for each frame. Is there a free library that will do this?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!