AlICe

Research →
Teaching →
Media →
Filters : Publication[x]
Relics of Electronic Hallucinations. Gazing at Early Computational Fluid Dynamics Drawings from Los Alamos Nuclear Research Center
2024
Rules, A Short History Of What We Live By, A book by Lorraine Daston
2024
Stoclet 1911 - Restitution
2024
From projection to building and vice versa
2023
Emergence of pre-digital algorithmic design
2023
Anthropic Units in Baroque Architecture, the Gallery of the Palazzo Spada and the Roman Palm
2023
Crossed Experimentations of Low-Altitude Surveys For The Detection Of Buried Structures
2022
Towards a multi-scale semantic characterization of the built heritage
2021
[x] Noise
2021
Jeu d’échelles / échelles du jeu
2021
Pohlke: One-Click Standard Orthographic and Oblique Projection Cameras
2021
Perspectiva Virtualis
2021
Exploitation des numérisations pour l'analyse urbaine en contexte archéologique
2020
Projection built into Sketchpad III: origin of a critical field in computer graphics
2020
Relecture de vocabulaires d’architecture : apport de la complexité des représentations numériques dans la caractérisation de formes architecturales
2019
Virtual Systems – Actual Objects: Rendition of Morphosis ' Compositional Principles in the mid 1980s
2018
Jean-Nicolas-Louis Durand’s Clockwork
2018
Le squelette de la Maison du Peuple : hypothèse de restitution 3D
2017
Morphosis Drawings and Models in the Mid 1980s: Graphic Description of Graphic Thinking
2016
Architecture « résolument » numérique : Paradigm Shift vs. paradigme albertien ?
2015
Reduce to Understand: a Challenge for Analysis and Three-dimensional Documentation of Architecture
2015
Analyse architecturale, modélisation 3D et narration filmique : un regard original sur quelques objets corbuséens
2015
Education in Architectural Analysis through Hybrid Graphic Means: a Setup for Critical Thinking
2014
La complexité inhérente aux modèles numériques et le paradigme de la représentation architecturale - Brèves considérations sur les pratiques contemporaines
2012
Photomodélisation de la Maison de Verre de Paul-Amaury Michel
2010
Architectural analysis and relevance of digital representation techniques - An educational experiment
2007
EXPLORER: A Procedural Modeler Based on Architectural Knowledge
1997

Noise

Author(s): Julien Rippinger, Raphael Ridder, Jan Schweizer

Contribution to the VOLUPTAS World At Play Summer School // Professur Charbonnet/Heiz (ETH Zurich D-ARCH) // 21-26 June 2021.

Download Link

// Noise Video Game Script: switch to bird eye and zoom out on certain events.
// Copyright (C) 2021 Julien Rippinger
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.


//  _   _  ___ ___ ____  _____
// | \ | |/ _ \_ _/ ___|| ____|
// |  \| | | | | |\___ \|  _|
// | |\  | |_| | | ___) | |___
// |_| \_|\___/___|____/|_____|
//

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SwitchCamera : MonoBehaviour
{

//                  _       _     _
// __   ____ _ _ __(_) __ _| |__ | | ___  ___
// \ \ / / _` | '__| |/ _` | '_ \| |/ _ \/ __|
//  \ V / (_| | |  | | (_| | |_) | |  __/\__ \
//   \_/ \__,_|_|  |_|\__,_|_.__/|_|\___||___/
//

    public Camera CameraPerspective;
    public Camera CameraAxonometry;
    public GameObject Avatar;
    public Light Sun;
    public AudioSource AudioSourceAxono;
    public AudioSource AudioSourceSoundtrack;
    public AudioSource AudioSourceVoice;
    public Text m_MyText;
    public Text title_Text;

    private GameObject[] points;
    private GameObject[] portals;
    private Collider[] collision_objects;
    private Vector3 newPosition;
    private int index;
    private int newindex;
    private bool startZoom = true;
    private bool zoomOut;
    private bool game_finished;
    private bool already_run;
    private float timeLeft;
    // private int nbrPoints;

    // Game Parameters
    private float maxTime = 109.0f; // +10 = 120
    private float timeIncrease = 10.0f;

    // Start is called before the first frame update

//  _       _ _   _       _   _
// (_)_ __ (_) |_(_) __ _| |_(_) ___  _ __
// | | '_ \| | __| |/ _` | __| |/ _ \| '_ \
// | | | | | | |_| | (_| | |_| | (_) | | | |
// |_|_| |_|_|\__|_|\__,_|\__|_|\___/|_| |_|
//

    void Start()
    {
        // AudioSourceAxono.Stop();
        CameraPerspective.enabled = true;
        CameraAxonometry.enabled = false;
        CameraAxonometry.orthographicSize = 1f;
        // teleportation points list
        points = GameObject.FindGameObjectsWithTag("Point");
        portals = GameObject.FindGameObjectsWithTag("Portal");
        // nbrPoints = points.Length;
        // initial index for teleportation
        // index = Random.Range(0,nbrPoints);
        // m_MyText.text = "";
        timeLeft = maxTime;
        //Zoom();
    }

//                  _       _
//  _   _ _ __   __| | __ _| |_ ___  ___
// | | | | '_ \ / _` |/ _` | __/ _ \/ __|
// | |_| | |_) | (_| | (_| | ||  __/\__ \
// \__,_ | .__/ \__,_|\__,_|\__\___||___/
//       |_|
//

    // Update is called once per frame
    void Update()
    {
        // countdown display
        float seconds = timeLeft%60;
        float minutes = Mathf.Floor(timeLeft / 60);
        if(!game_finished)
        {
            string time = minutes.ToString("00") + ":" + seconds.ToString("00.00");
            m_MyText.text = time;
        }
        // countdown
        timeLeft -= Time.deltaTime;
        if((timeLeft < 0) && (!already_run) &&(!game_finished))
        {
            startZoom = true;
        }
        Zoom();
    }

    void FixedUpdate()
    {
        collision_objects = Physics.OverlapSphere(transform.position, 1.0f);

        if(collision_objects.Length > 0)
        {
            foreach(Collider obj in collision_objects)
            {
                // check if player reached an antenna/portal
                if((obj.tag == "Portal") && (!already_run))
                {
                    title_Text.text = "Citizen of Proteus\nYou have contributed to our shared vision";
                    game_finished = true;
                    startZoom = true;
                    Zoom();
                }
                //Debug.Log("collision with:" + obj.tag);
            }
            //Debug.Log("collision : " + Physics.OverlapSphere(transform.position, 2.0f));
        }
    }

//                _
//  ___ _   _ ___| |_ ___  _ __ ___
// / __| | | / __| __/ _ \| '_ ` _  \
// |( _| |_| \__ \ || (_) | | | | | |
// \___|\__,_|___/\__\___/|_| |_| |_|
//

    void Zoom()
    {
        // initiate zoom out
        if(startZoom)
        {
            // start shepard sound
            AudioSourceAxono.Play();
            AudioSourceSoundtrack.Pause();
            AudioSourceVoice.Pause();

            // set sun for axo convetion
            PositionSun();
            // make the switch
            CameraPerspective.enabled = false;
            CameraAxonometry.enabled = true;
            zoomOut = true;
            already_run = true;
            // increment timer
            maxTime += timeIncrease;
            // force execute once
        }

        // perform zoom out
        if (zoomOut)
        {
            // zoom out
            CameraAxonometry.orthographicSize += 0.1f;
            m_MyText.text = "";
            startZoom = false;
        }

        // terminate zoom
        if (CameraAxonometry.orthographicSize > 240) //175
        {
            if(game_finished)
            {
                //quit game or switch to next scene
                Application.Quit();
            }

            // earase title
            title_Text.text = "";
            //stop zoom
            already_run = false;
            zoomOut = false;
            // stop shepard sound
            AudioSourceVoice.Play();
            AudioSourceSoundtrack.Play();
            AudioSourceAxono.Stop();
            // switch back to 1st person
            CameraAxonometry.enabled = false;
            CameraPerspective.enabled = true;
            // switch cast shadows on
            Sun.shadows = LightShadows.Soft;
            // reset axono
            CameraAxonometry.orthographicSize = 1f;
            // teleport player
            Teleportation();
            // reset timer
            timeLeft = maxTime;
        }

    }

    void PositionSun()
    {
        // no shadows
        // Sun.transform.forward = CameraAxonometry.transform.forward;

        // conventional shadows
        Sun.transform.forward = CameraAxonometry.transform.forward;
        Sun.transform.Rotate(0.0f, 135.0f , 0.0f, Space.World);
        Sun.shadows = LightShadows.None;
    }

    void Teleportation()
    {
        // random index selection
        // newPosition = new Vector3(points[index].transform.position.x, points[index].transform.position.y, points[index].transform.position.z);
        newPosition = GetClosestPoint(points);
        // move avatar into new position
        Avatar.transform.position = newPosition;
        int roatation = Random.Range(0, 360);
        Avatar.transform.Rotate(0.0f, roatation , 0.0f, Space.Self);
        //nex index different than previous one
        // newindex = Random.Range(0,nbrPoints); // between 0 and 31
        // while(newindex == index)
        // {
        //    newindex = Random.Range(0,nbrPoints);
        // }
        // index = newindex;
        // reset shadows
        //Sun.shadows = LightShadows.Soft;
    }

//        _   _ _
//  _   _| |_(_) |___
// | | | | __| | / __|
// | |_| | |_| | \__ \
//  \__,_|\__|_|_|___/
//

    Vector3 GetClosestPoint(GameObject[] point_list)
    {
        Vector3 tMin = new Vector3(Mathf.Infinity, Mathf.Infinity, Mathf.Infinity);
        float minDist = Mathf.Infinity;
        Vector3 currentPos = transform.position;
    	foreach (GameObject point in point_list)
            {
                float dist = Vector3.Distance(point.transform.position, currentPos);
                if (dist < minDist)
                {
                    tMin = new Vector3(point.transform.position.x,
                                       point.transform.position.y,
                                       point.transform.position.z);
                    minDist = dist;
                }
            }
        return tMin;
    }

}