mtr_addon:nte:js:train:example
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mtr_addon:nte:js:train:example [2024/02/07 08:32] – создано weryskok | mtr_addon:nte:js:train:example [2024/02/07 22:09] (current) – added source weryskok | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Train Rendering Example ====== | ====== Train Rendering Example ====== | ||
===== Based on the existing MTR model ===== | ===== Based on the existing MTR model ===== | ||
- | You can simply take the appearance of an existing model and add additional rendering logic using JS. | + | You can simply take the appearance of an existing model and add additional rendering logic using JS. It's probably easier to do it that way. |
===== Complete rendering control with JS ===== | ===== Complete rendering control with JS ===== | ||
+ | It's also possible to use '' | ||
+ | |||
The following code implements loading the OBJ model, selecting groups to display as needed to achieve an effect similar to the original MTR train. Feel free to copy it and modify it. | The following code implements loading the OBJ model, selecting groups to display as needed to achieve an effect similar to the original MTR train. Feel free to copy it and modify it. | ||
The following models are used: groups '' | The following models are used: groups '' | ||
- | < | + | < |
// Load groups from train.obj as Map of RawModel | // Load groups from train.obj as Map of RawModel | ||
var rawModels = ModelManager.loadPartedRawModel(Resources.manager(), | var rawModels = ModelManager.loadPartedRawModel(Resources.manager(), | ||
Line 105: | Line 107: | ||
return valueChange * (1 - Math.cos(Math.PI * (time - startTime) / timeChange)) / 2 + startValue; | return valueChange * (1 - Math.cos(Math.PI * (time - startTime) / timeChange)) / 2 + startValue; | ||
} | } | ||
+ | </ | ||
- | // The end! | + | ===== Source ===== |
+ | * https://www.zbx1425.cn/ | ||
- | </ |
mtr_addon/nte/js/train/example.1707294771.txt.gz · Last modified: 2024/02/07 08:32 by weryskok