Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


JavierOltra

Member Since 29 Nov 2012
Offline Last Active Jun 04 2013 12:53 AM

Posts I've Made

In Topic: GLSL - Reflection and tube intersection

29 November 2012 - 06:46 AM

Finally found the problem, this:

[source lang="cpp"]bool IntersectTubo(vec3 rayOrigin, vec3 rayDestination, vec3 tuboA, vec3 tuboB, float tuboRadius){ vec3 pointRay = ClosestPointLineLine(rayOrigin, rayDestination, tuboA, tuboB); vec3 pointTubo = ClosestPointRaySegment(tuboA, tuboB, rayOrigin, rayDestination); return (distance(pointRay, pointTubo) <= tuboRadius);}[/source]

Should be:

[source lang="cpp"]bool IntersectTubo(vec3 rayOrigin, vec3 rayDestination, vec3 tuboA, vec3 tuboB, float tuboRadius){ vec3 pointRay = ClosestPointLineLine(rayOrigin, rayDestination, tuboA, tuboB); vec3 pointTubo = ClosestPointRaySegment(rayOrigin, rayDestination, tuboA, tuboB); return (distance(pointRay, pointTubo) <= tuboRadius);}[/source]

PARTNERS