Comments (11)
This Is intentional because Babylon.js uses a system with y up. My blender uses a system with z up so I flip them to keep a visual continuity.
Does your blender use a y up coordinates system?
from babylon.js.
No, my blender (default install of the latest version on either Mac or Windows) uses a Z-up coordinate system. In the default 3D view, there's an X and Y grid with Z going up and down. So when I make a model that, for example, stays on Z = 0 but has objects along the X and Y axis, importing it into Babylon flips it on its side (since Z = Y in Babylon). I'll try changing the exporter code around to see if it fixes the issue. Or is there a way to change the coordinate system to be Y-up in Blender?
from babylon.js.
So when I change lines 66, 435, and 436 to flip Z and Y, for example changing this:
file_handler.write(",\""+name+"\":[" + "%.4f,%.4f,%.4f"%(vector.x,vector.z,vector.y) + "]")
to this:
file_handler.write(",\""+name+"\":[" + "%.4f,%.4f,%.4f"%(vector.x,vector.y,vector.z) + "]")
It works, but the model's textures seem to render inverted somehow. Here's an image of the way the existing export plugin renders in Babylon. The three cubes are the X (red), Y (green), and Z (blue) axes.
Here's the way my adaptation renders it:
The model should be pointing along the Y axis, which it does in my version of the exporter.
from babylon.js.
It is cool that you can have what you want but there is something I do nor understand here:) Could you share a blender scene you created? I would like to test because for me the y/z inversion is required
from babylon.js.
Definitely -- here's the files I've used to demo the issue: https://github.com/cyle/babylonjs-model-test
Just want to say that this project is amazing. I'm extremely impressed with how quickly I've been able to rig up a good-looking 3D game in no time with Javascript in the browser. This is an excellent project and I'm super excited to see it get even better. Thank you for all of your work!
from babylon.js.
Thank you :) I will have a look :)
from babylon.js.
According to the scene you sent, the object should point along the z axis of babylon.js (which is the Y axis of blender):
So I think the exporter behave well:
from babylon.js.
Okay, so that's how it should work between Blender and Babylon.js. So if we make models in Blender that we want to use in Babylon.js, we just need to make them along the Y axis if we expect them to be oriented correctly in Babylon.js. Is there any way Babylon.js could be changed so it works the other way, or is it required for the engine?
from babylon.js.
It is required by the fact that in this way, the image produced by blender is the same in babylon.js :)
from babylon.js.
Okay, cool. Just wanted to make sure that was the case. Thanks for your help!
from babylon.js.
Yep. Seems like this problem was not solved. Exporting with "Preserve Z-up right-handed" doesnt work eighter. I tried to export using Blender 2.91.2 and for preview https://sandbox.babylonjs.com/
from babylon.js.
Related Issues (20)
- Test support of pthread with wasm
- Support for triggers HOT 1
- Check why # character is rendered incorrectly with TextBuilder
- [Native] Pointer capture release HOT 3
- Create snapshot of a scene not using the main canvas fails
- NME Procedural Texture, Light Projection Texture Issue HOT 7
- [XR] Implement Space Warp support
- Add a helper function to copy a texture to another one HOT 2
- Input manager : PointerEvent pick with boundingBox HOT 1
- [Unit test] Revise and reintroduce loaders tests
- The example playground from docs doesn't compile in TS HOT 4
- Morph: use a uniform instead of a define for the number of active targets
- babylon webXR AR ground tracking not working in some devices HOT 2
- [XR] Node parented to the XR camera is incorrectly positioned
- Decal map: Add an option to apply it before or after the detail map HOT 2
- Gizmos misbehave when operating on child objects with configured pivot HOT 1
- Uncaught StandardMaterial needs to be imported before as it contains a side-effect required by your code HOT 1
- [Tooling] Support undo/redo HOT 2
- .glTF Export Instanced Meshes as Nodes Pointing to the Same Mesh
- [XR] support graphics-optimized quality in layers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylon.js.