Light and Mirrors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • YASIN786
    New Member
    • Feb 2007
    • 12

    #1

    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 :)
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    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.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      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

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Sorry will have to stop staying up way past my bedtime, looks like Plater has you on the right track.

        Comment

        • asia2007
          New Member
          • Sep 2007
          • 1

          #5
          Can anyone send me the sample source code?

          Comment

          Working...