macklebee Posted July 28, 2018 Share Posted July 28, 2018 Going through the documentation and I am trying to understand how the Plane functions work: https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Plane You don't have the ability to define the plane via something like Plane:Create() so how can you perform Plane:DistanceToPoint(), Plane:GetNormal(), etc? And then you also have Transform:Plane() that actually has an example to try but the program fails because the transformed plane comes back as nil? Did this work at one time and it was removed or was a work in progress that never got completed? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
SpiderPig Posted July 28, 2018 Share Posted July 28, 2018 You use the plane like a Vec3. The constructor can take three positions to define it, then you can use functions like GetNormal() and DistanceToPoint(). I imagine the positions as forming a triangle, and the plane extending out from that in all directions. Vec3 p1 = Vec3(-1.0f, -1.0f, -1.0f); Vec3 p2 = Vec3(0.0f, 1.0f, 1.0f); Vec3 p3 = Vec3(1.0f, 0.0f, 0.0f); Plane plane = Plane(p1, p2, p3); Vec3 normal = plane.GetNormal(); float distance = plane.DistanceToPoint(2, 1, 0); I'm not sure how to define it using the other constructors as shown in the example in Transform::Plane() 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 28, 2018 Author Share Posted July 28, 2018 Unfortunately this does not work in lua: plane = Plane(p1, p2, p3) but thanks for trying, anyways. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
SpiderPig Posted July 28, 2018 Share Posted July 28, 2018 That's okay. I'd say Josh needs to have a look at it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.