Hi~!
I am using the Dude.babylon
sample model provided in the Babylon Mesh Library page.
When dragging these assets to
Sandbox, it shows all the colors correctly like this.
However, when running codes on my server-side project,
import * as BBJS from 'babylonjs'
export class ModelSceneBuilder {
protected canvas: any;
protected engine: any;
protected scene: any;
protected camera: any;
constructor(canvas:any) {
this.canvas = canvas
}
async init() {
this.engine = new BBJS.Engine(this.canvas, true, { preserveDrawingBuffer: true, stencil: true })
this.scene = new BBJS.Scene(this.engine)
this.camera = new BBJS.FreeCamera('cam1', new BBJS.Vector3(50, 180, 150), this.scene)
this.camera.setTarget(BBJS.Vector3.Zero())
this.camera.attachControl(this.canvas, false)
const light = new BBJS.HemisphericLight('light1', new BBJS.Vector3(0, 1, 0), this.scene)
light.intensity = 0.4
this.engine.runRenderLoop(() => {
this.scene.render()
})
}
async loadModel(rootURL:string, fileName:string, textureSrc:string) {
const isPlugInAvailable = BBJS.SceneLoader.IsPluginForExtensionAvailable(".gltf")
console.log('Plugin Availability For GLTF ====>', isPlugInAvailable);
return new Promise((resolve, reject) => {
BBJS.SceneLoader.ImportMesh('', rootURL, fileName, this.scene, (meshes:any) => {
setTimeout(() => {
resolve(meshes)
}, 1000)
})
})
}
}
textures are mapped totally incorrectly.
As far as I know, even when the size of the texture is wrong, it should still be mapped on the mesh, but with different ratio. This one though, is mapped totally off
Anybody has experienced anything like this?