Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with a Game math problem using Unity... Project a point to a plane defined by 3 other points. You will need to

I need help with a Game math problem using Unity...

Project a point to a plane defined by 3 other points.

You will need to use Vector addition, subtraction, normalization, Dot and Cross products to solve this problem.

Note: Experienced developers should be able to solve this in 10 to 15 minutes and in 2 lines of inlined undocumented code. But please, definining variables while adding a few more lines of code makes it far more readable and easy to debug.

The points are: (Not that you necessarily need them..

pt 1 -.2248946x 5.672097y 4.211876z

pt 2 -2.39135x 4.4073y .070989z

pt 3 2.697184x 6.790536y -1.885628z

Bluept -.976281x 9.394463y -4.840367

Here is a visual to help aid in the idea-> need to get the Blue ball onto the plane Using game math.. Thank You!

Oh, and the clear ball on the plane's position (which should be the final answer) == 0.8102685x, 5.731036y, -4.656172z

image text in transcribedimage text in transcribed

Scene Shaded 2D Gizmos QAll Z Persp DotCross Challenge Assembly-CSharp using System.Collections; 2 using System.Collections.Generic; Lusing UnityEngine; AwNE 6 7 8 9 10 Unity Scriptoreferences public class DotCrossChallenge : MonoBehaviour { public Transform pti; public Transform pt2; public Transform pt3; public Transform pt_off_plane; Unity Message Oreferences void Start () { Vector3 pt = Vector3.zero; B #region STUDENT_CODE // Project pt_off_plane to the plane defined pti, pt2 and pt3 1/ 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #endregion pt_off_plane. localPosition pt; if ((GameObject. Find("Pt_projected"). transform.position - pt).magnitude

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions