DonKanallie Posted June 23, 2015 Share Posted June 23, 2015 Hey Everyone, I'm new to Babylon, but till now it worked great. I finished a little game for exercising with babylon, but now I'm trying to switch my main object to a blender object. I used a Box the whole time. Ok, for now i'm trying to append my new Blender Object to my box, thats all, but i can't figure it out. It's showing up, but i can't append it, so its flying with my ship(box). Here is the relevant part of my Ship.jsvar airplane;Ship = function (size, scene) { BABYLON.Mesh.call(this, "ship", scene); var vd = BABYLON.VertexData.CreateBox(size); vd.applyToMesh(this, false); BABYLON.SceneLoader.ImportMesh("", "assets/", "airplane.babylon", scene, function (newMeshes) { airplane = newMeshes[0]; airplane.position.x = 6.5; airplane.position.z = 0; airplane.position.y = 6.5; airplane.rotation.y = Math.PI*1.5; airplane.material = new BABYLON.StandardMaterial("shipMat", scene); //airplane.parent = vd; });};Would be great if somebody can help me =) Cheers, DonKanallie Quote Link to comment Share on other sites More sharing options...
jahow Posted June 24, 2015 Share Posted June 24, 2015 Hey, Maybe a stupid question: did you try without comment marks on this line?//airplane.parent = vd;Other than that, I don't see anything wrong. Are you sure there is only one mesh in your blender scene? Also, there is a simpler way to create a box mesh:var vd = BABYLON.Mesh.CreateBox("ship", size, scene); 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.