Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About DanielH

  • Rank
  1. DanielH

    How to find time of line-line-interception

    Numerical issues like those you describe is very easy to fix by adding making the opposite segment a bit wider while testing. What technique is best for different kind of generalizations I do not know. However to me it seems both these techniques has pretty much the same number of operations when using it on two segments. And no, I haven't tested it, so it might be right that v should be inverted.
  2. DanielH

    Differentiation & Integration

    Haha I know realize I should never write anything in the math forum.
  3. What algorithm are you using? If you use integral images to evaluate features and then use cascading you should definatively be able to do it real-time. Another optimization might be to do some skin color analysis first. One thing I'm thinking about implementing myself is to have interest regions that are scanned more often than "uninteresting" regions. If there is a face in an uninteresting region that region will be promoted to a interesting region and then there will be some kind of fall-off for each region to become uninteresting again if there havent been any faces detected there for a few frames.
  4. DanielH

    How to find time of line-line-interception

    Apparently I did not explain good enough. function test_collision(segment s1, s2, vector v1, v2) : float t t = inf; point p; vector v = v2 - v1 // // Test endpoints on s1 // // A line from s1.a which is one end point on s1, with v as direction line l1(s1.a, v) // test for intersection. intersection point is stored in p if intersection(l1, s2, &p) then float d = -dot(p - s1.a, v); if d > 0 then t = min(t, d) end end // Do exactly the same thing for the point s1.b // // Test endpoints on s2 // // A line from s1.a which is one end point on s1, with v as direction line l3(s2.a, v) // test for intersection. intersection point is stored in p if intersection(l3, s1, &p) then float d = dot(p - s1.a, v); // Note: No negation this time! if d > 0 then t = min(t, d) end end // Do exactly the same thing for the point s2.b return t end
  5. DanielH

    How to find time of line-line-interception

    You only have to perform 4 line-segment test. Each end point of the two segments defines in total 4 lines together with the vector v as the direction. Those lines you test against the line segments.
  6. DanielH

    How to find time of line-line-interception

    I just woke up and I'm a bit unclear in my head still, but just a thought: You have 2 line segments (s1 and s2) which only moves with a linear velocity each update. Since both moves linearly, the only thing that is relevant is the velocity difference between them. Lets say v = v2 - v1 Now for each point on s1, perform a line-segment collision between the segment s2 and the line that is intersecting each of the points and have the direction of v. Do the same thing for each point on s2. The time of the intersection should be the minimum distance between point and segment divided by the norm of v.
  7. DanielH

    Differentiation & Integration

    Your question is phrased a bit strange. You are asking about when differentiation and integration can be used? Differentiation and integration are the fundamentals of analysis. It's used in uncountable number of theorems and applications. * Differentiation You just gave an example where differentiation can be used: To find the velocity of an object! Differentiation is used to find the rate of change in a function. Normally it is a continuous function are differentiation, but when you are doing calculations in games such as finding out velocities you are often doing discreet differentiations. * Integration You actually gave and example of integration as well: present_position = old_position + dv * dt This is a simple sort of numeric integration called Euler integration. You integrate the position over time. Integration can be thought of a continuous version of the discreet summation. You can integrate different kind of areas and volumes, but there are many other uses for it.
  8. DanielH

    Extracting rotations from a 2D Square

    I'm sorry for answering this thread without actually having read it. However your question made me think of these pages which was linked from the webpage of a course i took a few months ago.
  9. Rendering with a 360 degree field of view would do it. However that is not possible with rasterization due to limitations in how that technique works. It would be possible with raytracing though but at the moment I think you are stuck with rendering six textures into a cubemap :)
  10. DanielH

    Beginner looking for help

    Maybe college could be something for you?
  11. DanielH

    Rotation in space

    If you have three orthogonal and normalized axes you can create a rotation matrix very easy. It's simply just putting each axis on each row of a 3x3 matrix.
  12. It sounds to me you should take some time to study how parsing is done: convert the input to tokens with a lexer etc. Will make it a lot easier to implement.
  13. No int multiplies? Almost sounds like programming a PIC, or some other 8-bit ucontroller. But it has floats? What is this thing?
  14. Now I know what the problem is with using Wu's algorithm to trace a line. Screenshot How can this be avoided? I'm thinking about if it's possible it can be solved like instead of using lines I rasterize a thicker line with two triangles. But perhaps there are easier approaches?
  15. Are you doing this for generating shadow maps? If so this might be a good read.
  • 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!