Online MTM2 truck viewer
Online MTM2 truck viewer
JSTruckViewer
I created a very simple, online POD truck viewer for MTM2 trucks based on the Three.js library.
JSTruckViewer is a browser-based pure javascript 3D viewer for MTM2 and 2.1 patch trucks. Drop in a POD or ZIP file from your local storage, or point it at a CORS-enabled URL, and the viewer decodes the complete truck model, textures, axles, driveshaft, axlebars, shocks and wheel placement in a render that you can freely move with your mouse. Latest version includes scene lighting and texture smoothing.
I hosted it on github pages so i can be previewed right away.
https://juanputrerasm.github.io/JSTruckViewer/
it is also directly implemented in the Trucks page thanks to Fila. This version supports podzipped trucks.
You need all the files mentioned in the TRK & BIN files inside the actual POD file. Missing textures are replaced by solid gray.
Source code: https://github.com/juanputrerasm/JSTruckViewer
*edited to reflect latests changes*
I created a very simple, online POD truck viewer for MTM2 trucks based on the Three.js library.
JSTruckViewer is a browser-based pure javascript 3D viewer for MTM2 and 2.1 patch trucks. Drop in a POD or ZIP file from your local storage, or point it at a CORS-enabled URL, and the viewer decodes the complete truck model, textures, axles, driveshaft, axlebars, shocks and wheel placement in a render that you can freely move with your mouse. Latest version includes scene lighting and texture smoothing.
I hosted it on github pages so i can be previewed right away.
https://juanputrerasm.github.io/JSTruckViewer/
it is also directly implemented in the Trucks page thanks to Fila. This version supports podzipped trucks.
You need all the files mentioned in the TRK & BIN files inside the actual POD file. Missing textures are replaced by solid gray.
Source code: https://github.com/juanputrerasm/JSTruckViewer
*edited to reflect latests changes*
Last edited by Kmaster on Wed Jun 03, 2026 3:48 pm, edited 2 times in total.
Re: Online MTM2 truck viewer
This is pretty neat. Probably have to cheat the tire position right?
Re: Online MTM2 truck viewer
The truck looks like is flying isn't it? but wheel position is based on the static.bpos values of each wheel, and the wheel itself is expected to be centered around its own origin.
the true cheat of sorts is on the axlebar. static.bpos values are used but then i had to re-center the model and scale it so it fits the inner faces of the wheels. Obviously this trick is not perfect, when rendering trucks likes BF Power wheels from RepFan the axlebar is separated from the wheels. So maybe the axlebar don't need any re-scaling at all
the true cheat of sorts is on the axlebar. static.bpos values are used but then i had to re-center the model and scale it so it fits the inner faces of the wheels. Obviously this trick is not perfect, when rendering trucks likes BF Power wheels from RepFan the axlebar is separated from the wheels. So maybe the axlebar don't need any re-scaling at all
Re: Online MTM2 truck viewer
The axle bar looks correct. Maybe it is somehow tied into the tires to begin. It would make sense since they move together with the tires.
I haven't touched the MTM2 code in a long time, I don't even know what are the latest versions that I was able to get to compile (as that is a hassle in its own right due to the spaghetti code from 20 years ago). lol. I will have to try and remember how to set it up again with the latest visual studio and see if I can spot anything about it in there (and work on having the viewer default to the missing stock parts).
I haven't touched the MTM2 code in a long time, I don't even know what are the latest versions that I was able to get to compile (as that is a hassle in its own right due to the spaghetti code from 20 years ago). lol. I will have to try and remember how to set it up again with the latest visual studio and see if I can spot anything about it in there (and work on having the viewer default to the missing stock parts).
Re: Online MTM2 truck viewer
in the meantime I added light support, removed the axle scaling and added a ground grid




Re: Online MTM2 truck viewer
Hey KMaster, not sure how you do the scaling in your rendering. I use OpenGL so everything is normalized. I multiple/scale the models by 1/65536.0f, swap x/z and negate z. the scrape points and wheel positions and axlebar/driveshaftpos I scale all by 1/32.0f and then the fourlinks are the absolute value of the the axlebars and the shock position is the wheel position * 0.256f x. kinda hard to explain if you want I can send some code or try and explain better.
Re: Online MTM2 truck viewer
Alright I realized why the trucks look like floating. There's two reasons and definitely in the MTM2 code.
1. The drive shaft is missing.
2. MTM adds some fake struts through code. The model itself doesn't have them but MTM2 code adds some 2D always-facing sprites to simulate the struts.
So the way the truck looks in the JViewer is the default position when the truck is in the air. In the game it doesn't look as odd because of the additional drive shaft and fake struts giving you the illusion it is all connected. Once it lands on the ground, it has a different "resting" position that I will have to look and see if I can find it. It's probably a fixed value for all the trucks since the game doesn't take into consideration weight etc.
1. The drive shaft is missing.
2. MTM adds some fake struts through code. The model itself doesn't have them but MTM2 code adds some 2D always-facing sprites to simulate the struts.
So the way the truck looks in the JViewer is the default position when the truck is in the air. In the game it doesn't look as odd because of the additional drive shaft and fake struts giving you the illusion it is all connected. Once it lands on the ground, it has a different "resting" position that I will have to look and see if I can find it. It's probably a fixed value for all the trucks since the game doesn't take into consideration weight etc.
- Attachments
-
- TRI_susp_cheat.jpg (167.13 KiB) Viewed 41176 times
Re: Online MTM2 truck viewer
Also... for some reason after downloading the latest version the axle bar won't show up anymore (and lights are not working).
Re: Online MTM2 truck viewer
I looked at BinEdit to see how it displays a truck (when you use import.trk) and it has the same missing driveshaft and fake struts, but it has the tires in the ground resting position.
Re: Online MTM2 truck viewer
Question: Where did you get those values? because mine are read directly from the BIN file header, the file tells you its own scale factor.Jpez1432 wrote: Sat May 23, 2026 9:00 am Hey KMaster, not sure how you do the scaling in your rendering. I use OpenGL so everything is normalized. I multiple/scale the models by 1/65536.0f, swap x/z and negate z. the scrape points and wheel positions and axlebar/driveshaftpos I scale all by 1/32.0f and then the fourlinks are the absolute value of the the axlebars and the shock position is the wheel position * 0.256f x. kinda hard to explain if you want I can send some code or try and explain better.
magnify power block type was something I discovered while working in JTraxx since it wasn't specified anywhere, at least not openly. I got some help from Striker (the dev of Terminal Fury) since I was having some issues with hellbender model scaling and found out about it. it wasn't even specified in the jtrfp library or Traxx source.
here's a complete AI agent code analysis:
Code: Select all
Each vertex component is a raw int32. The least significant bit is a geometry flag, not part of the coordinate, shift
it out first:
coordinate = rawInt32 >> 1
Then scale using magnifyPower, a value stored directly in the BIN file header (block type 0x14):
scaled = coordinate * (512.0 / magnifyPower)
The file is self-describing: magnifyPower is literally the second int32 in the file. It's almost always 65536, which
simplifies to coordinate / 128, but reading it from the file is the correct approach. Hardcoding 65536 will silently
produce wrong geometry for any BIN that uses a different value.
Skipping the >> 1 or using integer math instead of float will also break geometry.
Regarding TRK positions (wheel anchors, scrape points, axlebarOffset, driveshaftPos):
These are already in game units, no scaling needed. They are used as-is alongside the BIN-scaled vertices.
On the fourlinks and shock:
Fourlinks = abs(axlebarOffset) confirms the X component is a half-width magnitude, not a signed
lateral offset. The shock_x = wheel_x * 0.256 is good to have for suspension visualization.I "hard reload" and erased all cache data after deploying the new version. In chrome: Dev tools enabled > right click reload button > empty cache & hard reload. Otherwise it will fail to load.Fila wrote: Sun May 24, 2026 5:11 pm Also... for some reason after downloading the latest version the axle bar won't show up anymore (and lights are not working).
Good info, then in the meantime I can just squash the truck a little bit to make it look more familiar.Fila wrote: Sun May 24, 2026 4:53 pm So the way the truck looks in the JViewer is the default position when the truck is in the air. In the game it doesn't look as odd because of the additional drive shaft and fake struts giving you the illusion it is all connected. Once it lands on the ground, it has a different "resting" position that I will have to look and see if I can find it. It's probably a fixed value for all the trucks since the game doesn't take into consideration weight etc.
Re: Online MTM2 truck viewer
y-1.0 seems to do the trick. Funny enough, at that offset the wheels are actually clipping through the body, i never noticed that before!


Re: Online MTM2 truck viewer
Yeah. I only realized that now myself when I was looking for the fake struts.
Re: Online MTM2 truck viewer
i added ZIP file support and changed the theme. I saw this one in a three.js demo and liked it. it maches MTMG style also
now the viewer uses the fflate lib to extract zip files, then loads the first POD file found.
yeah, the BIN renderer needs some help
https://juanputrerasm.github.io/JSTruckViewer/
source
now the viewer uses the fflate lib to extract zip files, then loads the first POD file found.
yeah, the BIN renderer needs some help
source
Re: Online MTM2 truck viewer
Hey, looking better and better. Since I don't know three.js, I assume it only has one specific rendering option right?
I haven't had a chance but probably at the end of the week I will look into the mtm2 code to try and find how it handles the drive shaft/fake struts.
I haven't had a chance but probably at the end of the week I will look into the mtm2 code to try and find how it handles the drive shaft/fake struts.
Re: Online MTM2 truck viewer
Thanks for the help fila. I went ahead and implemented all the missing parts based on BinEdit truck editor; axlebars, driveshaft and shocks. and after some observation, fix the z-fighting issues three.js had with double sided faces. i kept the gravity hack (the y:-1.0 hack) now switchable. Now the app looks more production quality.


Re: Online MTM2 truck viewer
Oh wow this is looking great! I'll toy around with it in the weekend see if I can spot anything else. And I'm gonna think of how to incorporate it into the website.
Re: Online MTM2 truck viewer
Assets (like models and textures from base games like MTM 1 and 2) are missing when previewing a truck using online truck viewer. They always don't load properly, not even in "ART" and "MODELS" folders.
- Attachments
-
- missingassets.PNG (84.2 KiB) Viewed 29445 times
The monster truck garage of KimikoFan2...

Impact Monster Championship playlist:
https://www.youtube.com/playlist?list=P ... _NZQT6712_
The Monster Truck Community Server (feel free to join if you want):
https://discord.gg/SxwBuTRAJA
"I'm Army Armstrong. Are you ready for Microsoft's Monster Truck Madness?"
-Army Armstrong, 1996

Impact Monster Championship playlist:
https://www.youtube.com/playlist?list=P ... _NZQT6712_
The Monster Truck Community Server (feel free to join if you want):
https://discord.gg/SxwBuTRAJA
"I'm Army Armstrong. Are you ready for Microsoft's Monster Truck Madness?"
-Army Armstrong, 1996
Re: Online MTM2 truck viewer
yes, stock art and models are not included in the viewer.
i noticed that the pod file LegendOfWii_BoogeyVan2013.pod doesnt include them also, so the warnings in you screenshot are correct. basically Boogey Van 2013 is a podzipped truck and like i mentioned on the OP, these wont work correctly due to missing assets.
i noticed that the pod file LegendOfWii_BoogeyVan2013.pod doesnt include them also, so the warnings in you screenshot are correct. basically Boogey Van 2013 is a podzipped truck and like i mentioned on the OP, these wont work correctly due to missing assets.
Re: Online MTM2 truck viewer
So, can you at least fix it by including stock arts and models in the viewer?
The monster truck garage of KimikoFan2...

Impact Monster Championship playlist:
https://www.youtube.com/playlist?list=P ... _NZQT6712_
The Monster Truck Community Server (feel free to join if you want):
https://discord.gg/SxwBuTRAJA
"I'm Army Armstrong. Are you ready for Microsoft's Monster Truck Madness?"
-Army Armstrong, 1996

Impact Monster Championship playlist:
https://www.youtube.com/playlist?list=P ... _NZQT6712_
The Monster Truck Community Server (feel free to join if you want):
https://discord.gg/SxwBuTRAJA
"I'm Army Armstrong. Are you ready for Microsoft's Monster Truck Madness?"
-Army Armstrong, 1996
Re: Online MTM2 truck viewer
it's something i need to think about. Game assets are copyrighted content, and uploading them in github... not a good idea. Maybe we can add custom axles or wheels that look similar to stock models & art? or add the ability to replace these with your own supplied truck2.pod files? We'll figure it out.KF2416 wrote: Fri May 29, 2026 1:56 am So, can you at least fix it by including stock arts and models in the viewer?