Jump to content
  • Advertisement

Neoshaman

Member
  • Content Count

    559
  • Joined

  • Last visited

Community Reputation

180 Neutral

About Neoshaman

  • Rank
    Advanced Member

Personal Information

  • Interests
    Art
    Audio
    Business
    Design
    DevOps
    Production
    Programming
  1. I'm struggling to find the correct way to make ray intersection with curve that are swept along an axis.In theory I thought it should be simple, I decompose the problem into component:- find intersection on the curve (cross section), which is easy- extrude that intersection point into an axis aligned line, solve the slope intersection to that line to get the final offset.To be sure I got it right, I'm starting with a swept 45° line centered on origin (line-plane intersection with dot product would be more efficient, but remember I'm trying to validating swiping a long a line).- line equation is origine + directionVector * t- line to line intersection equation is t = (origine1 - origine2)/(directionVector2 - directionVector1) >> assuming they are never parallel.So let line2dIntersection(directionVector1,origine1,directionVector2,origine2)Assuming the ray start on the xy plane (pseudo code):- I first compute the cross section into xzintersection1 = line2dIntersection(rayDir.xz, vector2(origine.x,0), vector2(1,1).normalize(), vector2(0,0));result.xz = raydir.xz * intersection1;-Then find the slope swipe offset into yzintersection2 = line2dIntersection(rayDir.yz, vector2(origine.y,0), vector2(1,0).normalize(), vector2(0,result.z));result.y = raydir.y * intersection2;But all my result are garbage. What am I doing wrong? where is the leap of logic I did?
  • 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!