Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        //Transform Local to World coordinates(WorldOrigin)
        Vector3 worldPos = TransformPoint.InverseTransformPointUnscaled(WorldOrigin.transform, cam.transform.position);

        camWorldTxt.text = worldPos.ToString();
    }
        private Point Calculate(TransformPoint transformer, double height, double width)
        {
            var point = transformer(height, width);

            //do stuff to point
            return(point);
        }
Exemplo n.º 3
0
        public void TestTransformPointsWithString()
        {
            var    values    = FileToArray.Converter(@"C:\Users\emiol\Desktop\2nd year Assignment\Neuro Computing\Neuro Computing\TestNeuroComputing\TextFile2.txt");
            var    fileName  = @"C:\Users\emiol\Desktop\2nd year Assignment\Neuro Computing\Neuro Computing\TestNeuroComputing\ResultTransform.txt";
            string variables = "(-6.2885988031575; 12.460789807627599; 18.89248777613829; 37.120601271727345; -0.20593180312635412; 13.164690430237883)";

            TransformPoint.WriteTransformPointToFile(values.ToList(), variables, fileName);
        }
Exemplo n.º 4
0
        public void TestTransformPoints()
        {
            Vector3[] vectors = new Vector3[2];
            vectors[0] = new Vector3(1, 0, 0);
            vectors[1] = new Vector3(0, 1, 1);
            var points = TransformPoint.transformPoints(vectors, (float)Math.PI, (float)Math.PI / 3, (float)Math.PI / 2, 10, 1, 12);

            Assert.IsNotNull(points);
        }
Exemplo n.º 5
0
        public CubeMesh ApplyingTransformationToEachVertex(TransformPoint transformation)
        {
            CubeMesh res = new CubeMesh(this);

            for (int i = 0; i < vertices.Length; i++)
            {
                res.vertices[i] = transformation(vertices[i]);
            }
            return(res);
        }
Exemplo n.º 6
0
    /*!
     * \brief Save camero position to file
     *
     * Camera position in camera space is saved in CamLocalPosition.txt. Camera position in WorldOrigin space is saved in CamWorldPosition.txt.
     */
    void Update()
    {
        timeLeft -= Time.deltaTime;

        if (timeLeft <= 0.0f)
        {
            Vector3 localCamPos = cam.transform.position;
            Vector3 worldCamPos = TransformPoint.InverseTransformPointUnscaled(transform, localCamPos); //!< Transform point from Camera space to WorldOrigin space.

            //save coordinates
            FileModifier.Save("CamPosition/CamLocalPosition.txt", localCamPos.ToString());
            FileModifier.Save("CamPosition/CamWorldPosition.txt", worldCamPos.ToString());
            timeLeft = 1.0f;
        }
    }