Talk About Network

Google





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

Re: Reflecting a ray off a line

by "Richard" <some_email@[EMAIL PROTECTED] > Nov 17, 2007 at 03:40 PM

"Dieter Hansen" <dieter.hansen@[EMAIL PROTECTED]
> wrote in message 
news:473f064c$1@[EMAIL PROTECTED]
> 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

Dieter
Thanks.

I was just beginng to discover about use of the Normal in computing a 
reflected ray.

I will take your (sort of) algorithm (points 1-7) and flesh it out.

I'm hoping that I can produce a simple programme using Virtual Basic or
C#, 
employing the function/methods associated with Microsoft's  .NET library.

I was actually wondering whether "Drawlines" in the .NET library might
have 
been of use rather than "Drawline". I'll try to figure things out the best
I 
can given the steps you mention. I may ask one or two more questions
before 
I'm done. :c)

Rich
 




 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:34:09 PST 2009.