Jump to content

How to specify a target for a Arc Rotate Camera in Blender


altreality
 Share

Recommended Posts

I have tried to select Arc Rotate in the Babylon.js  Camera Type option in Blender. But while exporting it says in the log that the target was not specified:

	Babylon.js Exporter version: 1.6.2, Blender version: 2.73 (sub 0)========= Conversion from Blender to Babylon.js =========	Python World class constructor completed	processing begun of material:  loco.Material	WARNING texture type not currently supported:  NONE, ignored.	processing begun of material:  loco.Material.001	processing begun of material:  loco.Material.002	processing begun of mesh:  Cylinder.003		num positions      :  64		num normals        :  64		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  372	processing begun of mesh:  Cylinder.002		num positions      :  64		num normals        :  64		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  372	processing begun of mesh:  Cylinder.001		num positions      :  64		num normals        :  64		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  372	processing begun of mesh:  Cylinder		num positions      :  64		num normals        :  64		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  372	processing begun of camera (ArcRotateCamera):  Camera		ERROR: Camera type with manditory target specified, but no target to track set	processing begun of mesh:  Plane		num positions      :  4		num normals        :  4		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  6	processing begun of mesh:  chassis		num positions      :  8		num normals        :  8		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  36	processing begun of light (SUN):  Lamp========= Writing of scene file started ================== Writing of scene file completed ================== end of processing =========
Link to comment
Share on other sites

Ok, now I have got a free camera with target set in http://synth2014.github.io/Age-of-Steam/babylon/indexLocoScene.html

 

There is no mouse support by default for the free camera ? I can move the camera with the arrow keys but there is no response when using the mouse. Also when rotating around the target, the target seems to be receding away in a kind of spiral movement. Shortened babylon file :

{"autoClear":true,"clearColor":[0,0,0],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],"materials":[{"name":"new.Material","id":"new.Material","ambient":[0.8,0.6715,0.0617],"diffuse":[0.64,0.5372,0.0494],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true},{"name":"new.Material.001","id":"new.Material.001","ambient":[0.2076,0.8,0.1588],"diffuse":[0.1661,0.64,0.127],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true},{"name":"new.Material.002","id":"new.Material.002","ambient":[0.0012,0.0009,0.0111],"diffuse":[0.001,0.0007,0.0089],"specular":[0.5,0.5,0.5],"emissive":[0,0,0],"specularPower":50,"alpha":1,"backFaceCulling":true}],"multiMaterials":[],"skeletons":[],"meshes":[{"name":"Cylinder.003","id":"Cylinder.003","materialId":"new.Material.002","billboardMode":0,"position":[8,1.2,-1],"rotation":[-1.5708,0,0],"scaling":[0.5,1,0.5],"isVisible":true,"isEnabled":true,"useFlatShading":false,"checkCollisions":false,"receiveShadows":false,"positions":[0,0.05,1,0.1951,0.05,0.9808,0.1951,-0.05,0.9808,0.3827,0.05,0.9239,0.3827,-0.05,0.9239,0.5556,0.05,0.8315,0.5556,-0.05,0.8315,0.7071,0.05,0.7071,0.7071,-0.05,0.7071,0.8315,0.05,0.5556,0.8315,-0.05,0.5556,0.9239,0.05,0.3827,0.9239,-0.05,0.3827,0.9808,0.05,0.1951,0.9808,-0.05,0.1951,1,0.05,0,1,-0.05,0,0.9808,0.05,-0.1951.........,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":64,"indexStart":0,"indexCount":372}],"instances":[]},{"name":"Plane","id":"Plane","materialId":"new.Material.001","billboardMode":0,"position":[0,0,-500],"rotation":[0,0,0],"scaling":[550,1,550],"isVisible":true,"isEnabled":true,"useFlatShading":false,"checkCollisions":false,"receiveShadows":false,"positions":[1,0,-1,1,0,1,-1,0,1,-1,0,-1],"normals":[0,1,0,0,1,0,0,1,0,0,1,0],"indices":[0,1,2,3,0,2],"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":4,"indexStart":0,"indexCount":6}],"instances":[]},{"name":"Cube","id":"Cube","materialId":"new.Material","billboardMode":0,"position":[0,2,0],"rotation":[0,0,0],"scaling":[10,1,1.5],"isVisible":true,"isEnabled":true,"useFlatShading":false,"checkCollisions":false,"receiveShadows":false,"positions":[1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1],"normals":[0.5773,-0.5773,-0.5773,-0.5773,-0.5773,-0.5773,-0.5773,-0.5773,0.5773,-0.5773,0.5773,0.5773,-0.5773,0.5773,-0.5773,0.5773,0.5773,-0.5773,0.5773,0.5773,0.5773,0.5773,-0.5773,0.5773],"indices":[0,1,2,3,4,5,6,5,0,5,4,1,1,4,3,7,2,3,7,0,2,6,3,5,7,6,0,0,5,1,2,1,3,6,7,3],"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":8,"indexStart":0,"indexCount":36}],"instances":[]}],"cameras":[{"name":"Camera","id":"Camera","position":[3.1255,3.6096,19.6474],"rotation":[0.051,-2.9574,0],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"type":"FreeCamera","lockedTargetId":"Cube"}],"activeCamera":"Camera","lights":[{"name":"Lamp","id":"Lamp","type":1,"position":[4.0762,20.6462,1.0055],"direction":[-0.5664,-0.7947,-0.2184],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],"shadowGenerators":[]}
Link to comment
Share on other sites

Also I have specified the lamp in Blender to be the Sun, but it seems the Sun is not lighting up the rear of the cube. Are there any other settings needed for lights ?

 

 

If I select a arc rotate camera in blender and then add the track to constraint as specified above then my babylon file does not load. Does it work for you guys ?

 

Here are the last 2 lines of the generated babylon file:

"cameras":[{"name":"Camera","id":"Camera","position":[3.1255,3.0021,19.6474],"rotation":[-0.145,-2.9364,0],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"type":"ArcRotateCamera","alpha":1.413,"beta":1.5198,"radius":19.9197,"lockedTargetId":"Cube"}],"activeCamera":"Camera","lights":[{"name":"Lamp","id":"Lamp","type":1,"position":[4.0762,20.6462,1.0055],"direction":[-0.5664,-0.7947,-0.2184],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],"shadowGenerators":[]}
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...