Search Unity

Moving Directional Light in Sunpath

Discussion in 'Scripting' started by EatHeat, Jul 28, 2019.

  1. EatHeat

    EatHeat

    Joined:
    May 12, 2015
    Posts:
    5
    I am trying to create a 3D sunpath over my model in Unity (and Vuforia). The following image may help understand what I am trying to create.

    SunpathDiagram.jpg
    I am using SketchUp for my main model and Blender for the sunpath model. The VI Suite addon for Blender can create a working sunpath model for any location, time and date. Here is a video showing what I want to achieve in Unity -



    Also, Andrew Marsh has a wonderful web-app demonstrating exactly what I am trying to achieve - http://andrewmarsh.com/apps/staging/sunpath3d.html.

    This is what I have till now.

    2019-07-28 16_06_06-Unity 2019.1.8f1 Personal - 6-SunPath.unity - MetopixBase - Android _DX11_.png

    I have attached the Directional Light to the yellow sphere to act as the sun. How can I move and rotate the Directional Light so that it travels along the red lines of the sunpath while facing the center of the model(0,0,0)? Are there any plugins/assets (preferably free) that can help in what I am trying to achieve? I am fairly new to Unity so anything in detail would help.
     
  2. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    270
    DOTween has a DOPath script that can follow along a path.