Talk About Network

Google





Graphics > Raytracing rendering software > Re: Reflecting ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 22 Topic 555 of 588
Post > Topic >>

Re: Reflecting a ray off a line

by Dieter Hansen <dieter.hansen@[EMAIL PROTECTED] > Nov 17, 2007 at 04:18 PM

Richard schrieb:
> I'm absolute beginner to computer graphics. I'm just seeking hints to
get a
> feel for the nature of the task. I'm talking about 2D graphics. I'm not 
> seeking someone to do the task for me.
> 
> Lets say there is a line (line segment) and I wanted to get the computer
to
> draw a ray that reflected off the line at the angle of incidence to the
> line. Like a light ray hitting a flat mirror.
> 
> In just basic terms, what is required enabling the computer to end the
ray
> at the line intersection, and then draw another line segment (that
continues
> the ray), starting from the intersection and in the proper direction?
> 


1. define your line segment (most likely using point1 and point2)
2. define your ray (most likely using an origin and a direction)
3. calculate the intersection point between line segment and ray
4. create 2nd ray (the reflection ray)
	a. with the calculated intersection point as origin
	b. the direction can be calculated using the law of reflection
	   (basically this equation R = 2 · N ·(N dot -D)+D ; where R is 	 
the new direction, N the normal of the line segment and D 			    the 
incoming ray direction)


**** till here this is all mathematically and no drawing involved ****

5. draw your line segment
6. draw the first ray from its origin to the intersection point
7. draw the second ray from its origin to an arbitrary point in the ray

Regards
Dieter


> I think the basic task is drawing a polyline. That is the ray. I think
it
> might also involve testing the state of pixels. Well, how does the ray
stop
> at the line and then start off in a new direction? Is it something to do
> with reflection vectors?
> 
> I am trying to employ  managed code / VB or C# / .NET libraries.
> 
> Signed
> 
> "Completely out of my depth on this."
> 
> 
> 
> 
> 
>
 




 22 Posts in Topic:
Reflecting a ray off a line
"Richard" <s  2007-11-17 13:16:51 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-17 16:18:38 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-17 15:40:04 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-19 16:29:23 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-19 22:31:36 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-20 19:21:59 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-20 20:46:02 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-20 19:48:28 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-20 21:11:32 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 12:21:46 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 12:43:58 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 16:41:28 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 16:54:57 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-22 20:46:53 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 20:40:26 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-25 20:00:55 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-26 17:35:46 
Re: Reflecting a ray off a line
Dieter Hansen <dieter.  2007-11-26 23:41:37 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 23:53:12 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-23 00:25:08 
Re: Reflecting a ray off a line
dontdont@[EMAIL PROTECTED  2007-11-18 10:46:23 
Re: Reflecting a ray off a line
"Richard" <s  2007-11-22 12:29:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 20:33:11 PST 2009.