HOME
Hey Stranger
This is
#
cintix.dk and here you will find resources for developing
Unity 3D
and Java.
I'm currently working on updating my website and upload resources to
GitHub
.
All the resources you can find on my site are
FREE
,
And they will stay that way. If you like my work, then feel free to send me a donation from the menu, to keep me running on coffee
;-)
Right now I'm working on build a PlugIn for creating Day and Night cycles in Unity 3D . I have only just started, but this is what I got so fare.
They main thought it that user can set a day cycle (let's say 4 hours is one day) or manual with set the time of day. They script will use any lighting, that user want, so they can customize the lighting and shadows on there own. The plugin just turns it like the Sun, and giving the Day and Night effect. Then my plan is to give the option of added 2 or more skyboxes to the settings that will be blended withing the time of day.
using UnityEngine;
using System.Collections;
public class DayAndNightCycle : MonoBehaviour {
public GameObject worldLight;
public bool drawDome;
[Range(1,100)]
public int worldDomeScale = 5;
private Bounds _bounds;
private Light _light;
private GameObject _worldDome;
private int lastSec = 0;
private float _domeInternalSize;
// Use this for initialization
void Start () {
GetMyBounds ();
if (worldLight != null) {
_light = worldLight.GetComponent<Light>();
if (_light == null) {
Debug.Log ("Sorry you World light Object, doesnt contain a Light! Please and a light to the World light object");
return;
}
_worldDome = new GameObject ("WorldDome");
_domeInternalSize = _bounds.size.x;
if (_bounds.size.z > _domeInternalSize) _domeInternalSize = _bounds.size.z;
if (_bounds.size.y > _domeInternalSize) _domeInternalSize = _bounds.size.y;
_worldDome.transform.position = _bounds.center;
_worldDome.transform.localScale = (new Vector3(_domeInternalSize, _domeInternalSize, _domeInternalSize)) * worldDomeScale;
_light.transform.parent = _worldDome.transform;
_light.transform.position = Vector3.up * ((_domeInternalSize * worldDomeScale) /2);
_light.transform.eulerAngles = new Vector3 (90, 0, 0);
}
}
void OnDrawGizmosSelected() {
if (drawDome) {
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere (_bounds.center, ((_domeInternalSize * worldDomeScale) /2));
}
}
// Update is called once per frame
void Update() {
GetMyBounds();
if (_light != null)
_light.transform.LookAt (_bounds.center);
int sec = System.DateTime.Now.Second;
if (sec > lastSec) {
Debug.Log ("sec " + sec + " last sec : " + lastSec);
_worldDome.transform.Rotate (Vector3.forward * (360/60));
lastSec = sec;
} else if (sec < lastSec)
lastSec = 0;
}
private void GetMyBounds() {
_bounds = new Bounds();
Renderer[] renders = GetComponentsInChildren<Renderer>();
foreach (Renderer render in renders) {
_bounds.Encapsulate (render.bounds);
}
}
}
Lastest News
-
5 Years of Redemption
5 years ago I closed by website, due it was out of date. I promised myself, that I was going to rebuild it as soon as I had a new idea for a design. Well flies by when your not doing anything, and finally I took the time and redesigned cintix.dk
Now this doesn't mean, that I having been keeping myself busy. I have alot of open projects, that I'm going to show off in here. -
World Bounce - Unity 3D
I upload this little plugin for the Unity 3F asset store, where you can download it for FREE . World Bounce allows you to take any plane in Unity 3D ,and turn it into a "endless" world. The Player or any other Object can reaches the end of the Plane, will be teleported to opposite side of the Plane. The Plugin requires no coding from the user at all.