<p dir="auto">Hi, I was wondering if there is any planned support for "reflecting a vector" in Three.js's vector2.js or vector3.js files?  An example would be knowing both an incoming vector and a normal to a plane or surface, then calculating the outgoing vector after the vector intersects that plane.</p>
<p dir="auto">Here is an older GameDev page devoted to the mathematical implementation: <a href="http://www.gamedev.net/topic/360411-reflection-off-a-line/" rel="nofollow">http://www.gamedev.net/topic/360411-reflection-off-a-line/</a></p>
<p dir="auto">Should be easy to add to your vector.js library (maybe 2 or 3 lines of code max).</p>
<p dir="auto">Concrete example: Incoming ball strikes a non-axis-aligned wall, and we need to know the outgoing ball direction.  Maybe the final code that the Three.js user could type would be something like:  vector.Reflect(plane Normal).</p>
<p dir="auto">Would be a simple but very helpful function, especially if you are not wanting to add a hefty physics collision response engine to your project, and are just looking for a simple but effective solution that looks correct.</p>
<p dir="auto">Thanks!</p>
<p dir="auto">I'm testing the <a href="https://github.com/KhronosGroup/glTF-Blender-Exporter">Blender glTF 2.0 Exporter</a>, to export 3D models from Blender to be imported by Three.js r87 GLTFLoader used in <a href="https://github.com/freeciv/freeciv-web/">Freeciv WebGL</a>. Previously, I used the Three.js BinaryLoader to import the Three.js binary format files into Freeciv WebGL. However, when I try to upgrade to using glTF 2.0 (binary .glb) format instead, I currently have these issues:</p>
<ul dir="auto">
<li>The alpha transparency of materials is not shown in the glTG 2.0 version. This can be seen on the Settlers unit. Does the GLTFLoader support transparency?</li>
<li>The material looks much smooter in the old BinaryLoader version, than in the glTF 2.0 GLTFLoader version.</li>
<li>The glTF 2.0 file is 725 kb, while the Three.js binary format file is 612 kb. (This is not a bug, but it is interesting to note!)</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/210993/29493688-7a5b297e-859b-11e7-8f16-e1859d047141.png"><img src="https://user-images.githubusercontent.com/210993/29493688-7a5b297e-859b-11e7-8f16-e1859d047141.png" alt="gltf-2 0-bugreport" style="max-width: 100%;"></a></p>
<p dir="auto">The code I use to load the glTF 2.0 file is identical to the <a href="https://github.com/mrdoob/three.js/blob/dev/examples/webgl_loader_gltf.html">webgl_loader_gltf.html</a> example.</p>
<p dir="auto">Are these known limitiations of the glTF 2.0 GLTFLoader, or limitations of the Blender glTF 2.0 Exporter, or perhaps in my implementation ?</p>
<p dir="auto">I have attached the Blender file and the exported .glb 2.0 file here also.<br>
<a href="https://github.com/mrdoob/three.js/files/1236994/settlers.zip">settlers.zip</a></p>