three-cityjson
v0.1.0
Published
CityJSON loader and viewer for three.js and react-three-fiber
Downloads
3
Readme
three-cityjson
CityJSON loader and viewer for three.js and react-three-fiber
Contents
Installation
npm install three-cityjson
Usage
Loader
Three.js
import { CityJSONLoader } from "three-cityjson";
const loader = new CityJSONLoader();
loader.load("path/to/yourfile.city.json", (cityjson) => {
// Do something with the CityJSON object
});
React-three-fiber
import { CityJSONLoader } from "three-cityjson";
import { useLoader } from "@react-three/fiber";
export default function Component() {
const {
geometries,
vertexCount,
indexCount,
origin: modelOrigin,
} = useLoader(CityJSONLoader, "path/to/yourfile.city.json");
return <></>;
}
Viewer
WIP
License
MIT