예제 #1
0
파일: views.py 프로젝트: stanford-gfx/Horus
def reparameterize_spline():
  js = request.get_json()
  cameraPose_lat_list = js['cameraPoseLats']
  cameraPose_lng_list = js['cameraPoseLngs']
  cameraPose_alt_list = js['cameraPoseAlts']
  lookAt_lat_list = js['lookAtLats']
  lookAt_lng_list = js['lookAtLngs']
  lookAt_alt_list = js['lookAtAlts']

  T_cameraPose = c_[js['cameraPoseTvals'], js['cameraPoseTvals'], js['cameraPoseTvals']]
  T_lookAt = c_[js['lookAtTvals'], js['lookAtTvals'], js['lookAtTvals']]

  lookAt_easing_tvals = array(js['lookAtEasingT'])
  lookAt_easing_dlist = array(js['lookAtEasingD'])
  cameraPose_easing_tvals = array(js['cameraPoseEasingT'])
  cameraPose_easing_dlist = array(js['cameraPoseEasingD'])

  P_easingCameraPose = c_[cameraPose_easing_dlist]
  T_easingCameraPose = c_[cameraPose_easing_tvals]

  P_easingLookAt = c_[lookAt_easing_dlist]
  T_easingLookAt = c_[lookAt_easing_tvals]  

  P_cameraPose = c_[cameraPose_lat_list, cameraPose_lng_list, cameraPose_alt_list]

  P_lookAt = c_[lookAt_lat_list, lookAt_lng_list, lookAt_alt_list]

  T_linspace_norm_lookAt, T_user_progress_lookAt, P_user_progress_lookAt, ref_llh_lookAt = trajectoryAPI.reparameterize_spline(P_lookAt, T_lookAt, P_easingLookAt, T_easingLookAt)
  T_linspace_norm_cameraPose, T_user_progress_lookFrom, P_user_progress_lookFrom, ref_llh_lookFrom = trajectoryAPI.reparameterize_spline(P_cameraPose, T_cameraPose, P_easingCameraPose, T_easingCameraPose)

  data = {
    'lookAtReparameterizedT': T_user_progress_lookAt.tolist(), 
    'reparameterizedTime': T_linspace_norm_lookAt.tolist(),
    'lookFromReparameterizedT': T_user_progress_lookFrom.tolist(),
  }

  return jsonify(data)
예제 #2
0
def reparameterize_spline():
    js = request.get_json()
    cameraPose_lat_list = js['cameraPoseLats']
    cameraPose_lng_list = js['cameraPoseLngs']
    cameraPose_alt_list = js['cameraPoseAlts']
    lookAt_lat_list = js['lookAtLats']
    lookAt_lng_list = js['lookAtLngs']
    lookAt_alt_list = js['lookAtAlts']

    T_cameraPose = c_[js['cameraPoseTvals'], js['cameraPoseTvals'],
                      js['cameraPoseTvals']]
    T_lookAt = c_[js['lookAtTvals'], js['lookAtTvals'], js['lookAtTvals']]

    lookAt_easing_tvals = array(js['lookAtEasingT'])
    lookAt_easing_dlist = array(js['lookAtEasingD'])
    cameraPose_easing_tvals = array(js['cameraPoseEasingT'])
    cameraPose_easing_dlist = array(js['cameraPoseEasingD'])

    P_easingCameraPose = c_[cameraPose_easing_dlist]
    T_easingCameraPose = c_[cameraPose_easing_tvals]

    P_easingLookAt = c_[lookAt_easing_dlist]
    T_easingLookAt = c_[lookAt_easing_tvals]

    P_cameraPose = c_[cameraPose_lat_list, cameraPose_lng_list,
                      cameraPose_alt_list]

    P_lookAt = c_[lookAt_lat_list, lookAt_lng_list, lookAt_alt_list]

    T_linspace_norm_lookAt, T_user_progress_lookAt, P_user_progress_lookAt, ref_llh_lookAt = trajectoryAPI.reparameterize_spline(
        P_lookAt, T_lookAt, P_easingLookAt, T_easingLookAt)
    T_linspace_norm_cameraPose, T_user_progress_lookFrom, P_user_progress_lookFrom, ref_llh_lookFrom = trajectoryAPI.reparameterize_spline(
        P_cameraPose, T_cameraPose, P_easingCameraPose, T_easingCameraPose)

    data = {
        'lookAtReparameterizedT': T_user_progress_lookAt.tolist(),
        'reparameterizedTime': T_linspace_norm_lookAt.tolist(),
        'lookFromReparameterizedT': T_user_progress_lookFrom.tolist(),
    }

    return jsonify(data)
예제 #3
0
파일: views.py 프로젝트: stanford-gfx/Horus
def reparameterize_spline_ned():
  js = request.get_json()
  lookAtN   = js['lookAtN']
  lookAtE   = js['lookAtE']
  lookAtD   = js['lookAtD']
  lookFromN = js['lookFromN']
  lookFromE = js['lookFromE']
  lookFromD = js['lookFromD']

  P_lookFromNED      = c_[lookFromN, lookFromE, lookFromD]
  T_lookFromNED      = c_[js['lookFromT'], js['lookFromT'], js['lookFromT']]
  P_easingLookFrom = c_[array(js['lookFromEasingD'])]
  T_easingLookFrom = c_[array(js['lookFromEasingT'])]

  P_lookAtNED    = c_[lookAtN, lookAtE, lookAtD]
  T_lookAtNED    = c_[js['lookAtT'], js['lookAtT'], js['lookAtT']]
  P_easingLookAt = c_[array(js['lookAtEasingD'])]
  T_easingLookAt = c_[array(js['lookAtEasingT'])]  

  T_linspace_norm_lookAt, T_user_progress_lookAt, P_user_progress_lookAt, ref_llh_lookAt = trajectoryAPI.reparameterize_spline(P_lookAtNED, T_lookAtNED, P_easingLookAt, T_easingLookAt)
  T_linspace_norm_cameraPose, T_user_progress_lookFrom, P_user_progress_lookFrom, ref_llh_lookFrom = trajectoryAPI.reparameterize_spline(P_lookFromNED, T_lookFromNED, P_easingLookFrom, T_easingLookFrom)

  data = {
    'lookAtReparameterizedT': T_user_progress_lookAt.tolist(), 
    'reparameterizedTime': T_linspace_norm_lookAt.tolist(),
    'lookFromReparameterizedT': T_user_progress_lookFrom.tolist(),
  }

  return jsonify(data)
예제 #4
0
def reparameterize_spline_ned():
    js = request.get_json()
    lookAtN = js['lookAtN']
    lookAtE = js['lookAtE']
    lookAtD = js['lookAtD']
    lookFromN = js['lookFromN']
    lookFromE = js['lookFromE']
    lookFromD = js['lookFromD']

    P_lookFromNED = c_[lookFromN, lookFromE, lookFromD]
    T_lookFromNED = c_[js['lookFromT'], js['lookFromT'], js['lookFromT']]
    P_easingLookFrom = c_[array(js['lookFromEasingD'])]
    T_easingLookFrom = c_[array(js['lookFromEasingT'])]

    P_lookAtNED = c_[lookAtN, lookAtE, lookAtD]
    T_lookAtNED = c_[js['lookAtT'], js['lookAtT'], js['lookAtT']]
    P_easingLookAt = c_[array(js['lookAtEasingD'])]
    T_easingLookAt = c_[array(js['lookAtEasingT'])]

    T_linspace_norm_lookAt, T_user_progress_lookAt, P_user_progress_lookAt, ref_llh_lookAt = trajectoryAPI.reparameterize_spline(
        P_lookAtNED, T_lookAtNED, P_easingLookAt, T_easingLookAt)
    T_linspace_norm_cameraPose, T_user_progress_lookFrom, P_user_progress_lookFrom, ref_llh_lookFrom = trajectoryAPI.reparameterize_spline(
        P_lookFromNED, T_lookFromNED, P_easingLookFrom, T_easingLookFrom)

    data = {
        'lookAtReparameterizedT': T_user_progress_lookAt.tolist(),
        'reparameterizedTime': T_linspace_norm_lookAt.tolist(),
        'lookFromReparameterizedT': T_user_progress_lookFrom.tolist(),
    }

    return jsonify(data)