Posts

Unity Script Example

Image
    using UnityEngine; public class BoxieMotion : MonoBehaviour { Rigidbody myBody; public Rigidbody CappyBody; public Material cappyColor; public float xForce = 300; public float yForce = 300; // Start is called before the first frame update void Start() { myBody = this.GetComponent<Rigidbody>(); cappyColor.SetColor("_Color",Color.white); } // Update is called once per frame void Update() { if (Input.GetKeyDown("space")) { myBody.AddForce(xForce,yForce,0); } } private void OnCollisionEnter(Collision collision) { if (collision.gameObject.name == "Sphero") { Debug.Log("COLLIDED"); CappyBody.AddForce(0, 300, 0); cappyColor.SetColor("_Color", Color.yellow); } } }

Pacman Demo

Image
  This was an attempt at creating a pacman-inspired interaction in Processing. My code is as follows: float x,y,s; int wokkaPos,wokkaSpeed,wokkaDir; int flipMe1,flipMe2; void setup(){ size(500,500); background(0); x = width/2; y = height/2; s = 100; wokkaSpeed = 5; wokkaDir = 1; } void draw(){ wokkaPos += wokkaSpeed * wokkaDir; if(wokkaPos > 45){ wokkaDir = -1; } if(wokkaPos < 0){ wokkaDir = 1; } println(wokkaPos); background(0); fill(255,255,0); arc(x,y,s,s,radians(wokkaPos+flipMe1),radians((360-wokkaPos)+flipMe1)); if(keyPressed){ if(key == 'd'){ x += 5; flipMe1 = 0; } if(key == 'a'){ x -= 5; flipMe1 = 180; } if(key == 's'){ y += 5; flipMe1 = 90; } if(key == 'w'){ y -= 5; flipMe1 = -90; } } }    

Castle

Image
This week I attempted to create a castle using some of the basic geometry tools in Rhino. I took screenshots of the castle model from different perspectives to showcase the model's details.