Jump to content

WhoAteDaCake

Members
  • Content Count

    14
  • Joined

  • Last visited

About WhoAteDaCake

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Turns out the issue was me not exporting UV maps from blender.
  2. I have a mesh, that I would like to colour in a way, that the colour fades out near the edges. The sandbox: https://codesandbox.io/s/zw63povrz4 My current approach uses canvas, to first draw the color texture and then drawing an opacity layer that will fade the colour out. Expected result: https://i.imgur.com/YUCicAf.png My questions: Is there an easier method to do this. In my current approach The texture does not fit on the mesh, which means the mesh does not show any fading out, as can be seen in canvas on the side. How can that be f
  3. If someone also gets > this._light.needCube is not a function It's because you are using a HemisphericLight, would probably be good to add this information in docs
  4. Nevermind I am just stupid, if you look at createScene method, i was adding a second camera, even if one was already inside of the scene I am importing. That's the reason it was not showing anything
  5. Code: https://pastebin.com/zE0zhn7K So if you try to load a scene asynchronously, do something else, start the engine using that scene, The scene will just show an empty space. However, if you take a look at the code above, go to async function createScene(config) { const { textureModifier } = config; const { height, width, color } = config; const scene = new Scene(config.engine); await importScene(config.mesh, scene); And comment 'importScene' line, the go to async function run() { // await importScene(config.mesh, scene.internal); engine.runRender
  6. Okay, it turns out, that loader only accepts string type. So I can just do loader.load(scene, JSON.stringify(data))
  7. I have a .babylon file that I've read.And I need to load the mesh into the scene. What would be the best way to do it? I can't use HTTP requests, it has to import from that object. I've tried: const loader = BABYLON.SceneLoader.GetPluginForExtension('babylon'); loader.load(scene, data); But it gave an error: foot.babylon
  8. @Samuel Girardin THANK YOU SO MUCH!!!! Turns out I had to follow this tutorial. I just needed to apply the changes using Object apply. I am new to blender, so I didn't really know this....
  9. function addSphere(scene, { x, y, z }: Object, diameter: number = 0.05, color = new BABYLON.Color3(0, 0, 0)) { const sphere = BABYLON.MeshBuilder.CreateSphere("sphere", { diameter }, scene); const material = new BABYLON.StandardMaterial("texture1", scene); material.diffuseColor = color; sphere.position = new BABYLON.Vector3(x, y, z); sphere.material = material; } const positions = mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind); const zeroCoord = { x: positions[0], y: positions[1], z: positions[2], }; addSphere(scene, zeroCoord, 1); Demo As you ca
  10. Thank you @JCPalmer That is exactly what I ended up doing
  11. I am importing a generated foot mesh. After importing it I strip the jpg that's overlaid. Is it possible to modify color in parts of the foot. Let's say I'd want to make toes red, or half of the foot blue, can i do it after model is imported? Or do I have to overlay another mesh on top and color it ?
  12. Oh unfortunately no, it's a work in progress, so I have yet to deploy it anywhere :/ Edit: as @Deltakosh asked, i have deployed it
  13. @Deltakosh https://bitbucket.org/ajokub/footfalls-3d/, I've made few changes since i've posted this. I am currently just reloading whole webpage on change. You should comment out footData() from index.js. If you try to comment out one of the nodes inside Scene.js it reloads the canvas, but still has 9 nodes instead of 8
  14. // @flow // $FlowIgnore import * as BABYLON from 'babylonjs'; import shortid from 'shortid'; type Color = { r: number, b: number, g: number, }; export default class Scene { _scene: BABYLON.Scene; _camera: BABYLON.ArcRotateCamera; _light: BABYLON.HemisphericLight; constructor(engine: BABYLON.Engine, canvas: HTMLElement) { const scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color4(0.5, 0.8, 0.6, 0.8); const camera = new BABYLON.ArcRotateCamera('Camera', 1.5 * Math.PI, Math.PI / 8, 50, BABYLON.Vector3.Zero(), scene); camera.setTarget(BABYLON.V
×
×
  • Create New...