Matt Duffield Posted February 2, 2016 Share Posted February 2, 2016 Hi, I am working on some models created in MagicaVoxel and imported into Blender. I am trying to export the model facing a specific rotation so that when I export it from Blender to BabylonJS, it is displayed with the correct rotation. For some reason, regardless of what I set in Blender on the model, I always get the same orientation in BabylonJS. I would like to know if it is possible to have the orientation of the model show up correctly in BabylonJS? Can I view Blender's model with Y being Z so that I can be sure that when I export, it will display correctly in BabylonJS? I am hoping this is something simple that I am simply not understanding in Blender. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 3, 2016 Share Posted February 3, 2016 It is kind of guess work without out some kind of pictures, but you should know that everything is automatically swapped between y and z on export. Maybe you are over thinking this. If MagicaVoxel imports things that results in things being on their side, use transform UI (toggled with the 'n' key) to get it looking right in Blender. Unless you bake in any rotation or scale (recommended), it will be export as the original, but rotated in BJS during import. Could also be a camera problem. Quote Link to comment Share on other sites More sharing options...
Matt Duffield Posted February 3, 2016 Author Share Posted February 3, 2016 Hi JCPalmer, Perhaps if I attached the obj and png files exported from MagicaVoxel, you can try it on your end. I import it into Blender and then scale it down. Next, if I understand you correctly, I rotate the plane into the correct orientation/rotation so that it should be accurate when exported to BabylonJS. I do this by click Ctrl+A and selecting Rotation. Finally, I export it out. However, it always gets imported and is viewed the same when I load the file in BabylonJS. What I would like to see though is that the orientation of the X,Y,Z is normal like the rest of BabylonJS meshes as follows: My goal is to export the model from Blender already in the correct orientation/rotation without needing to change anything and have it left-hand. I am not sure if this is possible but I wanted to know what my workflow should be. If you can import the obj and png files into Blender and then export them so that they line up correctly, I would love to know how to do this. Thanks again for your response, Matt plane.obj Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 3, 2016 Share Posted February 3, 2016 Ok, first you might look at this topic & the playgrounds for gun sights. The plane there is built with internal shapes, but you might find it useful. Your Blend file picture looks close to a top view. That is the way is should export. Quote Link to comment Share on other sites More sharing options...
Matt Duffield Posted February 4, 2016 Author Share Posted February 4, 2016 Okay, great! Thanks for the tip. I will definitely take a look at it. I am using the Gamepad API and the FollowCamera. Is there a way to keep the camera from doing a 360 rotation around the plane when I am turning left or right? I would like to only allow a certain maximum angle for plane but the camera seems to get out of sync. Also if I rotate too much my Y rotation becomes my pitch rotation? I am sure this is pretty simple but it has me stumped for the moment. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.