Closed erikangelin-king closed 7 years ago
And here are my version details, if that's of any use:
Defold version | 1.2.98 |
Defold sha | 6725d7a9bc8fc85b3d6759eb5ed7dfb9df2cf9fb |
Build time | 2017-02-21T10:13:40.438078 |
OS name | Windows 10 |
OS version | 10.0 |
OS arch | amd64 |
Java version | 1.8.0_102-b14 |
http://forum.defold.com/t/builtin-model-material-doesnt-apply-world-transform/5445
ericsroy
Hi there,
Just experimenting with placing 3D models in my scene. What I'm noticing is that the builtin "model" vertex program transforms by view and projection, but never applies a world matrix. This is analogous to the builtin "sprite" vertex program, except that sprites should already be defined in world space, so that makes sense. In the case of models however, shouldn't the engine make the assumption that they need a world matrix applied to position them within the scene?
The way this manifests itself is that no matter where I position the game object that owns my model component, the mesh is rendered sitting at the origin. This seems like a bug to me, but maybe I've just made some mistaken assumptions.
A subsequent issue -
I cloned and modified the model shader so that it applies a worldview matrix instead of just a view matrix. Now, when the game runs, the mesh is correctly positioned in the scene. However, in the editor, the mesh is still displayed sitting at the origin. I guess my question is: The editor uses my actual material/shaders when it renders the scene doesn't it? So at the very least, the editor and the game should show models in identical position/orientation, right?
Note: I'm using Editor2, so this could just be an oddity of the new editor that has yet to be sorted out. If that's the case, I can report it as a github issue.