I want to control the position of a directional light. I have a gizmo connected to it.
On first initialization of the scen the gizmo is visible, but if I hit my button to restart the scene the gizmo and the light gizmo disappear and will not reappear unless I refresh the browser.
Here is how I am doing it.
const dirLight = new DirectionalLight(
“dirLight”,
new Vector3(0, -10, 10),
scene
); //dirLight.position = new Vector3(0, 0, 0);
dirLight.position = new Vector3(0, 400, -400);
var lightGizmo = new LightGizmo();
lightGizmo.light = dirLight;
if (lightGizmo.attachedMesh) {
lightGizmo.attachedMesh.position = new Vector3(0, 400, -400);
}
var m = new GizmoManager(scene)
m.positionGizmoEnabled = true;
m.rotationGizmoEnabled = true;
m.usePointerToAttachGizmos = false;
m.attachToMesh(lightGizmo.attachedMesh)
I cannot figure this out and cannot find anyone else having this issue.
Well, because I am fairly new to babylon, and actually vue as well. I am still wrapping my head around this. This stack is totally new to me coming from .NET and C#. I am learning though.
So getting started with vuetify and sticking a babylon canvas in it is a little different than even three.js in a .NET app.
I followed a tutorial to get babylon in vue so that kind of has road blocked me with some of the things I need to do.