https://github.com/gkjohnson/source-engine-model-loader
Three.js loader for parsing Valve's Source Engine models
https://github.com/gkjohnson/source-engine-model-loader
games geometry graphics javascript mdl model source-engine source-engine-sdk threejs valve vmt vtf vtx vvd
Last synced: about 2 months ago
JSON representation
Three.js loader for parsing Valve's Source Engine models
- Host: GitHub
- URL: https://github.com/gkjohnson/source-engine-model-loader
- Owner: gkjohnson
- License: mit
- Created: 2019-10-09T16:06:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T23:50:31.000Z (over 1 year ago)
- Last Synced: 2025-04-05T20:22:51.135Z (6 months ago)
- Topics: games, geometry, graphics, javascript, mdl, model, source-engine, source-engine-sdk, threejs, valve, vmt, vtf, vtx, vvd
- Language: JavaScript
- Homepage: https://gkjohnson.github.io/source-engine-model-loader/dist/index.html
- Size: 11.3 MB
- Stars: 76
- Watchers: 5
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# source-engine-model-loader
[](https://github.com/gkjohnson/source-engine-model-loader/actions)
[](https://github.com/gkjohnson/source-engine-model-loader/)
[](https://twitter.com/garrettkjohnson)Unofficial Three.js loader for parsing Valve's Source Engine models built by referencing the data structures in the [ValveSoftware/source-sdk-2013](https://github.com/ValveSoftware/source-sdk-2013) project and the source engine [wiki](https://developer.valvesoftware.com/wiki/MDL). Demo models from the [Source Filmmaker](https://store.steampowered.com/app/1840/Source_Filmmaker/) installation.

Get models from [SFMLab](https://SFMLab.com) or [Source Filmmaker](https://store.steampowered.com/app/1840/Source_Filmmaker/).
Demo [here!](https://gkjohnson.github.io/source-engine-model-loader/dist/index.html)
# License Information
Models shown in this repo are not covered by the code license, copyright their respective owners, and are for demo purposes only.
# Use
```js
import { SourceModelLoader } from 'source-engine-model-loader';new SourceModelLoader()
.load( './folder/model', ( { group } ) => {scene.add( group );
} );
```# API
## SourceModelLoader
### constructor
```js
constructor( manager : LoadingManager )
```### load
```js
load(
url : string,
onComplete : ( { group : Group } ) => void
) : void
```Loads the set of Source Engine model files at the given path. It is expected that a model with the extensions `.mdl`, `.vvd`, and `.vtx` exist.
# Unimplemented Features
See [issue #4](https://github.com/gkjohnson/source-engine-model-loader/issues/4) for full list of unimplemented features.