User Tools

Site Tools


mtr_addon:nte:js:train:example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mtr_addon:nte:js:train:example [2024/02/07 08:33] weryskokmtr_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 ''base_type'' and not use MTR's built-in model drawing process at all, instead using JS to control it all.
 +
 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.
  
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;
 } }
 +</code>
  
-// The end!+===== Source ===== 
 +  * https://www.zbx1425.cn/nautilus/mtr-nte/#/js-example-train
  
-</code> 
mtr_addon/nte/js/train/example.1707294785.txt.gz · Last modified: 2024/02/07 08:33 by weryskok