|
@@ -153,24 +153,7 @@ OSG_Scene [Scene]
|
|
└─RootNode_(model_correction_matrix) [Object3D]
|
|
└─RootNode_(model_correction_matrix) [Object3D]
|
|
└─4d4100bcb1c640e69699a87140df79d7fbx [Object3D]
|
|
└─4d4100bcb1c640e69699a87140df79d7fbx [Object3D]
|
|
└─RootNode [Object3D]
|
|
└─RootNode [Object3D]
|
|
- ├─Camera_3 [Object3D]
|
|
|
|
- │ └─*no-name* [Object3D]
|
|
|
|
- ├─Physical_Sky_1 [Object3D]
|
|
|
|
- │ ├─Sky_Null [Object3D]
|
|
|
|
- │ │ ├─Sun [Object3D]
|
|
|
|
- │ │ │ ├─Lensflare_Source [Object3D]
|
|
|
|
- │ │ │ │ └─*no-name* [Object3D]
|
|
|
|
- │ │ │ │ └─*no-name* [Object3D]
|
|
|
|
- │ │ │ └─Sun_light [Object3D]
|
|
|
|
- │ │ │ └─*no-name* [Object3D]
|
|
|
|
- │ │ │ └─*no-name* [Object3D]
|
|
|
|
- │ │ └─Moon [Object3D]
|
|
|
|
- │ │ └─Moon_Light [Object3D]
|
|
|
|
- │ │ └─*no-name* [Object3D]
|
|
|
|
- │ │ └─*no-name* [Object3D]
|
|
|
|
- │ └─Sky_Dome [Object3D]
|
|
|
|
- │ └─*no-name* [Object3D]
|
|
|
|
- │ └─*no-name* [Object3D]
|
|
|
|
|
|
+ │ ...
|
|
├─Cars [Object3D]
|
|
├─Cars [Object3D]
|
|
│ ├─CAR_03_1 [Object3D]
|
|
│ ├─CAR_03_1 [Object3D]
|
|
│ │ └─CAR_03_1_World_ap_0 [Mesh]
|
|
│ │ └─CAR_03_1_World_ap_0 [Mesh]
|
|
@@ -202,193 +185,7 @@ OSG_Scene [Scene]
|
|
│ │ └─CAR_03_2_2_World_ap_0 [Mesh]
|
|
│ │ └─CAR_03_2_2_World_ap_0 [Mesh]
|
|
│ ├─Car_04_2_2 [Object3D]
|
|
│ ├─Car_04_2_2 [Object3D]
|
|
│ │ └─Car_04_2_2_World_ap_0 [Mesh]
|
|
│ │ └─Car_04_2_2_World_ap_0 [Mesh]
|
|
- │ ├─Car_08_1 [Object3D]
|
|
|
|
- │ │ └─Car_08_1_World_ap15_0 [Mesh]
|
|
|
|
- │ ├─Car_08 [Object3D]
|
|
|
|
- │ │ └─Car_08_World_ap16_0 [Mesh]
|
|
|
|
- │ ├─Car_08_5 [Object3D]
|
|
|
|
- │ │ └─Car_08_5_World_ap17_0 [Mesh]
|
|
|
|
- │ ├─CAR_03_2_3 [Object3D]
|
|
|
|
- │ │ └─CAR_03_2_3_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Car_08_6 [Object3D]
|
|
|
|
- │ │ └─Car_08_6_World_ap19_0 [Mesh]
|
|
|
|
- │ └─CAR_03_3 [Object3D]
|
|
|
|
- │ └─CAR_03_3_World_ap_0 [Mesh]
|
|
|
|
- ├─Block_2 [Object3D]
|
|
|
|
- │ ├─Lights [Object3D]
|
|
|
|
- │ │ ├─traffic_light [Object3D]
|
|
|
|
- │ │ │ └─traffic_light_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_3 [Object3D]
|
|
|
|
- │ │ │ └─Light_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_2 [Object3D]
|
|
|
|
- │ │ │ └─Light_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_1 [Object3D]
|
|
|
|
- │ │ │ └─Light_1_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light [Object3D]
|
|
|
|
- │ │ │ └─Light_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─traffic_light_1 [Object3D]
|
|
|
|
- │ │ │ └─traffic_light_1_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─traffic_light_2 [Object3D]
|
|
|
|
- │ │ └─traffic_light_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Base_1 [Object3D]
|
|
|
|
- │ │ ├─Floor_4 [Object3D]
|
|
|
|
- │ │ │ └─Floor_4_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Floor [Object3D]
|
|
|
|
- │ │ └─Floor_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes [Object3D]
|
|
|
|
- │ │ ├─Bed [Object3D]
|
|
|
|
- │ │ │ └─Bed_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Bushes_3 [Object3D]
|
|
|
|
- │ │ └─Bushes_3_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes_1 [Object3D]
|
|
|
|
- │ │ ├─Bed_2 [Object3D]
|
|
|
|
- │ │ │ └─Bed_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Bushes_3_2 [Object3D]
|
|
|
|
- │ │ └─Bushes_3_2_World_ap_0 [Mesh]
|
|
|
|
- │ └─House [Object3D]
|
|
|
|
- │ └─House_World_ap_0 [Mesh]
|
|
|
|
- ├─Block_4 [Object3D]
|
|
|
|
- │ ├─Bench_1 [Object3D]
|
|
|
|
- │ │ └─Bench_1_World_ap_0 [Mesh]
|
|
|
|
- │ ├─House_2 [Object3D]
|
|
|
|
- │ │ └─House_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Lights_2 [Object3D]
|
|
|
|
- │ │ ├─Light_3_2 [Object3D]
|
|
|
|
- │ │ │ └─Light_3_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_2_2 [Object3D]
|
|
|
|
- │ │ │ └─Light_2_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_1_2 [Object3D]
|
|
|
|
- │ │ │ └─Light_1_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Light_2_3 [Object3D]
|
|
|
|
- │ │ └─Light_2_3_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Base [Object3D]
|
|
|
|
- │ │ ├─Floor_4_2 [Object3D]
|
|
|
|
- │ │ │ └─Floor_4_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Floor_2 [Object3D]
|
|
|
|
- │ │ └─Floor_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Trees [Object3D]
|
|
|
|
- │ │ ├─Firtree_47 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_47_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_3 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_2 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_1 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_1_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree [Object3D]
|
|
|
|
- │ │ │ └─Firtree_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Cube_7 [Object3D]
|
|
|
|
- │ │ │ └─Cube_7_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Firtree_4 [Object3D]
|
|
|
|
- │ │ └─Firtree_4_World_ap_0 [Mesh]
|
|
|
|
- │ └─Bench [Object3D]
|
|
|
|
- │ └─Bench_World_ap_0 [Mesh]
|
|
|
|
- ├─Block_1 [Object3D]
|
|
|
|
- │ ├─Muff_1 [Object3D]
|
|
|
|
- │ │ └─Muff_1_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Muff [Object3D]
|
|
|
|
- │ │ └─Muff_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Lights_3 [Object3D]
|
|
|
|
- │ │ ├─Light_3_3 [Object3D]
|
|
|
|
- │ │ │ └─Light_3_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_2_4 [Object3D]
|
|
|
|
- │ │ │ └─Light_2_4_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_1_3 [Object3D]
|
|
|
|
- │ │ │ └─Light_1_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_3_4 [Object3D]
|
|
|
|
- │ │ │ └─Light_3_4_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_4 [Object3D]
|
|
|
|
- │ │ │ └─Light_4_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Light_5 [Object3D]
|
|
|
|
- │ │ └─Light_5_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Base_2 [Object3D]
|
|
|
|
- │ │ ├─Floor_4_3 [Object3D]
|
|
|
|
- │ │ │ └─Floor_4_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Floor_3 [Object3D]
|
|
|
|
- │ │ └─Floor_3_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Trees_2 [Object3D]
|
|
|
|
- │ │ ├─Firtree_47_2 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_47_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_3_2 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_3_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_2_2 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_2_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_1_2 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_1_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Firtree_2_3 [Object3D]
|
|
|
|
- │ │ │ └─Firtree_2_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Cube_7_2 [Object3D]
|
|
|
|
- │ │ │ └─Cube_7_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Firtree_4_2 [Object3D]
|
|
|
|
- │ │ └─Firtree_4_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bench_2 [Object3D]
|
|
|
|
- │ │ └─Bench_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Behch [Object3D]
|
|
|
|
- │ │ └─Behch_World_ap_0 [Mesh]
|
|
|
|
- │ └─House_3 [Object3D]
|
|
|
|
- │ └─House_3_World_ap_0 [Mesh]
|
|
|
|
- ├─Block_3 [Object3D]
|
|
|
|
- │ ├─Shop [Object3D]
|
|
|
|
- │ │ └─Shop_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Trash [Object3D]
|
|
|
|
- │ │ └─Trash_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Trash_2 [Object3D]
|
|
|
|
- │ │ └─Trash_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Lights_4 [Object3D]
|
|
|
|
- │ │ ├─Light_3_5 [Object3D]
|
|
|
|
- │ │ │ └─Light_3_5_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Light_2_5 [Object3D]
|
|
|
|
- │ │ │ └─Light_2_5_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Light_4_2 [Object3D]
|
|
|
|
- │ │ └─Light_4_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Base_3 [Object3D]
|
|
|
|
- │ │ ├─Floor_4_4 [Object3D]
|
|
|
|
- │ │ │ └─Floor_4_4_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Floor_4_5 [Object3D]
|
|
|
|
- │ │ └─Floor_4_5_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes_1_2 [Object3D]
|
|
|
|
- │ │ ├─Bed_3 [Object3D]
|
|
|
|
- │ │ │ └─Bed_3_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Bushes_15 [Object3D]
|
|
|
|
- │ │ │ └─Bushes_15_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Bushes_2 [Object3D]
|
|
|
|
- │ │ │ └─Bushes_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Bushes_2_2 [Object3D]
|
|
|
|
- │ │ │ └─Bushes_2_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Tree_1 [Object3D]
|
|
|
|
- │ │ │ └─Tree_1_World_ap_0 [Mesh]
|
|
|
|
- │ │ ├─Tree_2 [Object3D]
|
|
|
|
- │ │ │ └─Tree_2_World_ap_0 [Mesh]
|
|
|
|
- │ │ └─Tree_3 [Object3D]
|
|
|
|
- │ │ └─Tree_3_World_ap_0 [Mesh]
|
|
|
|
- │ └─Bushes_3_3 [Object3D]
|
|
|
|
- │ ├─Bed_4 [Object3D]
|
|
|
|
- │ │ └─Bed_4_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes_15_2 [Object3D]
|
|
|
|
- │ │ └─Bushes_15_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes_2_3 [Object3D]
|
|
|
|
- │ │ └─Bushes_2_3_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Bushes_4 [Object3D]
|
|
|
|
- │ │ └─Bushes_4_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Tree_1_2 [Object3D]
|
|
|
|
- │ │ └─Tree_1_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─Tree_2_2 [Object3D]
|
|
|
|
- │ │ └─Tree_2_2_World_ap_0 [Mesh]
|
|
|
|
- │ └─Tree_3_2 [Object3D]
|
|
|
|
- │ └─Tree_3_2_World_ap_0 [Mesh]
|
|
|
|
- ├─ROAD [Object3D]
|
|
|
|
- │ ├─ROAD_World_ap_0 [Mesh]
|
|
|
|
- │ ├─traffic_light_2_2 [Object3D]
|
|
|
|
- │ │ └─traffic_light_2_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─traffic_light_1_2 [Object3D]
|
|
|
|
- │ │ └─traffic_light_1_2_World_ap_0 [Mesh]
|
|
|
|
- │ ├─traffic_light_2_3 [Object3D]
|
|
|
|
- │ │ └─traffic_light_2_3_World_ap_0 [Mesh]
|
|
|
|
- │ └─ROAD_Lines_12 [Object3D]
|
|
|
|
- │ └─ROAD_Lines_12_World_ap_0 [Mesh]
|
|
|
|
- └─Floor_5 [Object3D]
|
|
|
|
- └─Floor_6 [Object3D]
|
|
|
|
- └─Floor_6_World_ap_0 [Mesh]
|
|
|
|
|
|
+ ...
|
|
```
|
|
```
|
|
|
|
|
|
From that we can see all the cars happen to be under parent
|
|
From that we can see all the cars happen to be under parent
|
|
@@ -503,6 +300,8 @@ the new `Object3D` a `cars` array.
|
|
|
|
|
|
This fixes the orientation of the cars.
|
|
This fixes the orientation of the cars.
|
|
|
|
|
|
|
|
+{{{example url="../threejs-load-gltf-rotate-cars-fixed.html" }}}
|
|
|
|
+
|
|
Now let's drive them around
|
|
Now let's drive them around
|
|
|
|
|
|
Making even a simple driving system is too much for this post but
|
|
Making even a simple driving system is too much for this post but
|
|
@@ -653,7 +452,11 @@ scale.
|
|
|
|
|
|
And not just scale, in this case the cars are rotated and offset
|
|
And not just scale, in this case the cars are rotated and offset
|
|
by their parent, the `Cars` node. This will make it hard at runtime
|
|
by their parent, the `Cars` node. This will make it hard at runtime
|
|
-to move the cars around in world space.
|
|
|
|
|
|
+to move the cars around in world space. To be clear, in this case
|
|
|
|
+we want cars to drive around in world space which is why these
|
|
|
|
+issues are coming up. If something that is meant to be manipulated
|
|
|
|
+in a local space, the the moon revolving around the earth this
|
|
|
|
+is less of an issue.
|
|
|
|
|
|
Going back to the function we wrote above to dump the scene graph,
|
|
Going back to the function we wrote above to dump the scene graph,
|
|
let's dump the position, rotation, and scale of each node.
|
|
let's dump the position, rotation, and scale of each node.
|