Forum

Author Topic: Export xml from 3DSMax  (Read 1807 times)

darkmoon3d

  • Newbie
  • *
  • Posts: 4
    • View Profile
Export xml from 3DSMax
« on: December 07, 2016, 12:29:50 AM »
Trying to export marker positions and camera position and orientation from 3DSMax into XML file. Have been able to successfully export marker 2D images for each frame but not sure camera is working. Am exporting marker and camera positioning data from Syntheyes and using a custom Maxscript to convert points and camera into marker xml and camera xml file to input within Photoscan.

Code: [Select]
CameraMatrix3 = camera_out.transform.rotation as matrix3
CameraMatrix3array = #()
CameraMatrix3array = (filterstring (CameraMatrix3 as string) "[,]") --[1] as float)
CameraMatrix3string = CameraMatrix3array[2] + " " + CameraMatrix3array[3] + " " + CameraMatrix3array[4] + " " + CameraMatrix3array[6] + " " + CameraMatrix3array[7] + " " + CameraMatrix3array[8]  + " " + CameraMatrix3array[10]  + " " + CameraMatrix3array[11] + " " + CameraMatrix3array[12] + " " + CameraMatrix3array[14] + " " + CameraMatrix3array[15] + " " + CameraMatrix3array[16]

Example data from following code would give me following:
Code: [Select]
      <camera id="0" label="bow-test-_00000.jpg" sensor_id="0" enabled="true">
        <resolution width="1920" height="1080" />
        <transform>0.985758 -0.168169 0.001091 -0.00274616 -0.00960994 0.99995 -0.16815 -0.985711 -0.0099349 0 0 0</transform>
      </camera>

Am also not providing all intrinsic values of camera and only provide x and focal length:
Code: [Select]
    <sensors>
      <sensor id="0" label="unknown" type="frame">
        <resolution width="1920" height="1080" />
        <property name="fixed" value="false" />
        <calibration type="frame" class="initial">
          <resolution width="1920" height="1080" />
          <fx>1418.46</fx>
          <fy>1418.46</fy>
        </calibration>
      </sensor>


Region is also being disregarded. Would including this help? So far importing camera xml is not showing anything on screen.

Should intrinsic values of camera be set to 'initial' or 'adjusted'?