Пример #1
0
        private static void CreateMeshScene(Scene <PositionNormal> scene)
        {
            var transform = new Transform
            {
                Position = .5f * float3.up,
                Scale    = 2 * float3.one,
                Rotation = float3(-pi / 2, 0, 0)
            };
            var guitarBody = new GuitarBody <PositionNormal>(transform, 5, 5);

            guitarBody.ComputeNormals();
            scene.Add(guitarBody.RaycastGeometry, guitarBody.TransformMatrix);

            var transform2 = new Transform
            {
                Position = 2.5f * float3.up,
                Scale    = float3.one,
                Rotation = float3(0, pi / 2, 0)
            };
            var microphone1 = new Microphone <PositionNormal>(transform2);

            microphone1.ComputeNormals();
            scene.Add(microphone1.RaycastGeometry, microphone1.TransformMatrix);

            scene.Add(
                Raycasting.PlaneXZ.AttributesMap(a => new PositionNormal {
                Position = a, Normal = float3(0, 1, 0)
            }),
                Transforms.Identity);
        }
Пример #2
0
        private static SceneObject <V> CreateMeshScene <V>() where V : struct, INormalVertex <V>
        {
            var transform = new Transform
            {
                Position = 3f * float3.up,
                Scale    = 2 * float3.one,
                Rotation = float3(0, 0, 0)
            };
            var obj = new GuitarBody <V>(transform, 10, 10);

            obj.ComputeNormals();
            obj.Mesh = obj.Mesh.Transform(obj.TransformMatrix);
            return(obj);
        }