It's weekend again, so time to play around with krpano
And even though I just made a video on how to convert GLB to OBJ for use in krpano, here is a GLB importer for krpano using threejs (0.147).
Using this helper, you can import GLB and lights into the krpano scene using standard krpano xml and even manipulate the objects location using standard krpano actions.
Demo: https://krpano.kri-soft.be/threejshelper/
To use the helper, include the plugin and then you can use these tags in your tour.xml:
<threejsmodel name="ram" url="ram.glb" tx="0" ty="0" tz="0" rx="0" ry="0" rz="0" scale="10"></threejsmodel>
<threejsmodel name="cube" url="cube.glb" tx="0" ty="10" tz="0" rx="0" ry="0" rz="0" scale="10"></threejsmodel>
<threejslight name="hemi" type="HemisphereLight" color="0xffffff" strength="0.1" helper="true" tx="0" ty="-10" tz="0"></threejslight>
<threejslight name="sun" type="DirectionalLight" color="0xffffff" strength="0.5" helper="true" tx="10" ty="-17.5" tz="-10" castshadow="true"></threejslight>
<threejslight name="light" type="PointLight" color="0x00ffff" strength="1" helper="true" tx="-10" ty="-2" tz="10" castshadow="true"></threejslight>
<threejslight name="light2" type="PointLight" color="0xaaaa00" strength="1" helper="true" tx="-5" ty="-2" tz="5" castshadow="true"></threejslight>
Features
- support for glb (only glb, no obj
- 3 light types: HemisphereLight, DirectionalLight, PointLight
- control the objects through standard krpano actions
Limitations:
- code is not public (sorry, not ready for release)
- scale, helper true/false and castshadow cannot be animated (only location, rotation and (light) strenght and color)
- no mouse events for the objects
- no dynamic adding/removing of objects (only possible to define them in xml)
- no scene support
- no animations
- many many more limitations :)
As you can see, it's still early development. Depending on the interest, I might develop this further, so ... let me know what you think about this!
Project can be downloaded here if you want to play around yourself...
https://krpano.kri-soft.be/threejshelper/…20230401_01.zip
gr,
Kristof