Code (using C#):
using UnityEngine;
using System.Collections;
public class rotate : MonoBehaviour {
void Update ( ) {
transform.Rotate(new Vector3 (15, 30, 45) * Time.deltaTime);
}
}
Today is created an object in unity 3D and applied some physical application. Unity provides assets/packages to use but my unity had some compatibility issues so i decided to just create it from scratch. In the scene that i created in unity 3d, I added a cube and directional lighting to show a surface of the cube. For the C# coding aspect of the cube I added a rotation by using the command transform.Rotate( ). I also added a speed variable which is being multiplied by Time.deltaTime which just smooths out the movement for the values given from each frame of the rotation. Another cooling thing is that the speed variable is public. So, you can adjust the speed to whatever you choose while its rotating. Unfortunately, this isn't really physics. It's just a simulated speed being multiplied by a time per frame. If I wanted to apply real physics to the cube I would have to add a constant force (component) and set a value for the torque. Code (using C#): using UnityEngine; using System.Collections; public class rotate : MonoBehaviour { void Update ( ) { transform.Rotate(new Vector3 (15, 30, 45) * Time.deltaTime); } }
3 Comments
ed lee
7/15/2014 02:56:42 pm
I like where you are going with this. I was looking at some crohn's disease videos and they said that a lot of treatment has to do with diet regulation. You know... one thing that I would like to do more of is keep track of all my food... as in food diary. It would be nice if we could use google glass to recognize food products and even make estimates of volume of food eaten. So perhaps the several pictures of food taken at different angles as well as an algorithm taking into account the height of the user and relative size of the hand in the picture we can make tracking of food easier?
Reply
9/21/2016 05:50:36 am
When you say cheat, normally we are talking about fake followers. Fake followers can be bought for cheap, but as Luka Marr says it doesn't Instagram Cheat Sheet To Get More Followers, Likes, and Comments by Bill Ross.
Reply
Leave a Reply. |
AuthorYathin Latif is a upcoming sophomore originally a Biology major but became interested in computing and code. He is now working towards a BS in computer science. Learning new languages and tools to further his goals. This summer he hopes to learn as much as possible over these few weeks. Looking to learn more about in software and mobile development. Archives
August 2014
Categories |