PowenKo > Unity > Begin > Rotate

January 20, 2012   ·   0 Comments

Screen Shot 2012-01-20 at 1.15.32 PM

Quaternion rotateX = Quaternion.AngleAxis(45, Vector3.right);		
		Quaternion rotateY = Quaternion.AngleAxis(90, Vector3.up);	
		Quaternion rotateZ = Quaternion.AngleAxis(90, Vector3.forward );
		
		
		transform.rotation = rotateY * rotateX*rotateZ;


transform.eulerAngles = new Vector3(0, 270, 0);

move and step by step

 public float target = 270.0F;
    public float speed = 2.0F;
    void Update() {
        float angle = Mathf.MoveTowardsAngle(transform.eulerAngles.y, target, speed * Time.deltaTime);
        transform.eulerAngles = new Vector3(0, target, 0);
    }


    void Update() {
		
			Vector3 t1=m_car.transform.position;
		t1.y=500;
		gameObject.transform.position=t1;
		
        float angle = Mathf.MoveTowardsAngle(transform.eulerAngles.y, target, speed * Time.deltaTime);
		//m_car.transform.eulerAngles;
        transform.eulerAngles = new Vector3(90, m_car.transform.eulerAngles.y, m_car.transform.eulerAngles.z);
    }
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon