Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Insta360 One

Specs

notes: The bottom lens needs to be flipped horizontaly

blendAngle = 20;
FOV = 210;
mapFunction = (n) => {
  return -8.8568 * Math.pow(10,-9) * Math.pow(n, 4) + 1.1095 * Math.pow(10,-6) * Math.pow(n, 3) + -5.045 * Math.pow(10,-5) * Math.pow(n, 2) + 2.4317 * Math.pow(10,-2) * n; 
}

unwrap

  public function map(param1:Number, param2:Number) : Point
  {
     var _loc3_:Number = param2 * Math.PI;
     var _loc4_:Number = Math.cos(_loc3_);
     var _loc5_:Number = Math.sin(_loc3_);
     var _loc6_:Number = param1 * Math.PI * 2;
     var _loc7_:Number = _loc5_ * Math.cos(_loc6_);
     var _loc8_:Number = _loc5_ * Math.sin(_loc6_);
     var _loc9_:Vector3D = this.transformVector(new Vector3D(_loc7_,_loc8_,_loc4_));
     _loc3_ = Math.atan2(Math.sqrt(_loc9_.x * _loc9_.x + _loc9_.y * _loc9_.y),_loc9_.z) / Math.PI * 180;
     _loc6_ = Math.atan2(_loc9_.y,_loc9_.x);
     var _loc10_:Number = this._lens.map(_loc3_) / this._lens.map(this._lens.fieldOfView / 2) * this._lens.radius;
     var _loc11_:Number = _loc10_ * Math.cos(_loc6_) + this._lens.centerX;
     var _loc12_:Number = _loc10_ * Math.sin(_loc6_) + this._lens.centerY;
     _loc11_ = _loc11_ / this._lens.originWidth;
     _loc12_ = _loc12_ / this._lens.originHeight;
     var _loc13_:Point = new Point(_loc11_,_loc12_);
     if(this._uvFramsform)
     {
        this._uvFramsform.call(null,_loc13_);
     }
     return _loc13_;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment