import numpy as np

from simple_3dviz import Lines, Spherecloud
from simple_3dviz.behaviours.misc import LightToCamera
from simple_3dviz.behaviours.movements import CameraTrajectory
from simple_3dviz.behaviours.trajectory import Circle
from simple_3dviz.behaviours.io import SaveFrames
from simple_3dviz.utils import render
from simple_3dviz.window import show


if __name__ == "__main__":
    points = np.array([
        [0.03496624, -0.4723329,  -0.02637232],
        [0.03424914, -0.38429058, -0.04774554],
        [0.0390897,  -0.31340447, -0.03743242],
        [0.03730257, -0.24494073, -0.02153015],
        [-0.13056846, -0.2267276,   0.06165987],
        [-0.16537493, -0.28884387,  0.03130089],
        [-0.18657628, -0.36001873,  0.01393732],
        [-0.2056852,  -0.45386904,  0.01062474],
        [0.02926839, -0.15803142, -0.02115165],
        [0.0491225,  -0.10730278,  0.001254],
        [0.01329138, -0.03072703, -0.06867763],
        [0.04706671, -0.02920819,  0.01334804],
        [-0.1138855,  -0.11051873,  0.05227949],
        [-0.10956886, -0.13876641,  0.04329066],
        [-0.09353743, -0.03100512, -0.04349776],
        [-0.08633196, -0.02354074,  0.02689737],
        [0.07980453,  0.08336258, -0.03348995],
        [0.00127693,  0.08648632, -0.06349777],
        [-0.00372324,  0.06101485,  0.05373947],
        [0.02931256,  0.13969943,  0.04758224],
        [-0.07085561,  0.1854981,  -0.01251608],
        [-0.08501478,  0.08730197, -0.03007746],
        [-0.2747325,   0.11887977, -0.02393699],
        [-0.18173946,  0.19762556, -0.04584916],
        [-0.00075296,  0.44299334, -0.00646337],
        [0.00776821,  0.36928397, -0.01387711],
        [0.00775032,  0.27719203, -0.02083887],
        [-0.07311475,  0.2800464,  -0.05349565],
        [0.09813186,  0.2514349,  -0.05162171],
        [0.06995263,  0.22113597,  0.02499798],
        [0.2917657,   0.11937696,  0.00506067],
        [0.21196616,  0.17858423, -0.02221516],
    ])

    s = Spherecloud(points, colors=(0.8, 0.2, 0.4), sizes=0.03)
    l = Lines(points, (0.1, 0.1, 0.1), width=0.02)
    show(
        [s, l],
        up_vector=(0, 1.0, 0),
        camera_position=(0, 0, 1.5),
        size=(256, 256),
        behaviours=[
            CameraTrajectory(
                Circle(
                    (0, 0, 0),
                    (0, 0.0, 1.5),
                    (0, 1.0, 0)
                ),
                speed=0.01
            ),
            LightToCamera()
        ]
    )
