![]() ![]() Var mag = Vector.subtract(, Global.Mouse).magnitude() Var v1 = Vector.subtract(Global.Mouse, ).normalize() Var rect = canvas.getBoundingClientRect() The definition is set up with some controls for those of you wanting to use this as a plug'n play definition.Global.$canvas.addEventListener('mousemove', function(e) The angle intensity could be used to cull objects or panels and the red and yellow gradient starts to show how one can do some surface analysis or form finding based on relflections during the design process. ![]() I wont go into that for this tutorial, but it is included in the final file available for download below. The rest of the definition colours the reflection angles based on the intensity of the reflection, it also creates arrows and lines that can be colored. In order to actually see the vectors, use a "Vector Display" component as I have done. If you do not know how to use the "Function" component, just plug in 3.141593 which is basically PI. Now for the angle we want 180 degrees in Radians, which is the same as PI. ![]() Next, for our rotation vector use the Normal from our Line/Surface Intersection component and plug N into X of the "Vector Rotate" component. Plug your reversed vectors into 'V' and graft the input (right click V and choose 'Graft'). In order to do this we use the "Vector Rotate" component. We want to rotate the vectors we created by 180 degrees around the surface normal so that it mimics an angle of reflection. This next part might lose those who are not familiar with functions/expressions. Plug these new vectors in a "reverse vectors" component. Now we want to reverse our vectors so that they are pointing back at us. Create vectors in the same way that you created the lines using "Vector 2 Point" component and like wise make sure A and B are plugged in respectively. Here is where we deal with the vector calculations between the surface and the rays. Now use the "Surface|Line Intersection" component to get the intersection points of the surface and our rays/lines. Make sure that you flatting the points coming from the "Surface Divide" component. However, it will benifit you in the long run as this definition will use any lines/rays that hit a surface to calculate the reflections.Ĭreate lines using the "2 Point Line" component, by plugging in our source point into A and our surface points into B. This is not the conventional way to find surface vectors/normals mind you. Next, we need to create lines to intersect with the surface. Green points are the subdivisions of the surface and the red is our source point. You should now have something that looks similar to the images below. Your reference surface should be the ofted surface we created before. To do this we subdivide the surface with the "Divide Surface" component. Next, we need to decide how many test samples / rays we want on the surface. So create and reference a point from rhino. First we need to create a source point for the light or sound source. You should have the lofted surface referenced inside GH. Create Profiles and Loft them so that you have a Surface to work with inside GH. Lets start by creating a surface from which we will calculate the reflections. Firstly, it all comes down to angles and so we will be working with vectors inside of GH. Lets start by understanding what is required in order to calculate the reflections. Rhino has the "Bounce" command built in, which accomplishes this, however, to date, grasshopper does not have a native component to do this. How do you calculate the reflection of light or sound. ![]() The reflection issue or request comes up a lot during our workshops. The attached file uses the resulting angle for color gradient analysis, but you could use it to cull out objects.ĭOWNLOAD :> This tutorial demonstrates how one can do some surface analysis or form finding based on relflections. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |