469,268 Members | 961 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,268 developers. It's quick & easy.

Light and Mirrors

Hi ol
My name is yasin
i am currently developing an application in vbnet 2003
the requirements are as follows:
On the form will be located a number of points (no more than 4) through a light ray must pass. The light ray emerges in a specific direction from a fixed point.
Pls note the light ray is to be represented by a line
The light is deflected by reflection using a suitable number of plane mirrors.
Note that for a plane mirror the angle of reflection and the angle of incidence are equal.

The simulated system must allow the user to place simulated mirrors in the enclosed area to reflect the light ray to follow a path that will make the light ray illuminate all the designated fixed points.
this means dynamically placing lines (simulated mirrors) with mouse operations in the path of the simulated light beam; another line.

As soon as a mirror is placed then the light beam will be reflected and thus change course. Clearly the first attempt of placing the mirror is unlikely to direct the beam exactly as required so is essential that the mirror can be rotated about the point where the beam hits until the desired effect is achieved.

Once the simulation is showing the light beam passing through all the designated points then the system will report on the exact location and orientation of the mirrors.

At the moment i have managed through some research to create a label which can be moved around the form at runtime. the label will repersent the mirror. I even have the four fixed points and the source of the light ray on the form. By instantiating a class called clsBeam i can even draw the lines which will represent the the beam

Any ideas or even code on how to deflect the line (light ray) and how to rotate the label about the middle point will be highly appreciated.

Thanking you in advance.
Regards :)
Sep 6 '07 #1
4 1300
kenobewan
4,871 Expert 4TB
I believe the important thing is to decode the voices behind the ray of light. Clearly you need an event triggered by light if you are to have such an sequence happen. What is unclear to me is how all this is going to work.
Sep 6 '07 #2
Plater
7,872 Expert 4TB
Most of this seems like it should be done with the Graphics object and actually drawing on the screen.
However for this particualr style of application I would suggest more like directx/gdi stuff. The graphics libraries are much more powerfull.

But a basic hit test on your mirrors and then some vector math should produce desired results
Sep 6 '07 #3
kenobewan
4,871 Expert 4TB
Sorry will have to stop staying up way past my bedtime, looks like Plater has you on the right track.
Sep 7 '07 #4
Can anyone send me the sample source code?
Sep 27 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by DesignGuy | last post: by
354 posts views Thread by Montrose... | last post: by
13 posts views Thread by Ramza Brown | last post: by
1 post views Thread by Andrew Rawnsley | last post: by
9 posts views Thread by Dan Vande More | last post: by
6 posts views Thread by Jon | last post: by
68 posts views Thread by Santiago Romero | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.