当前位置: 首页>>代码示例>>C++>>正文


C++ Projector::map方法代码示例

本文整理汇总了C++中Projector::map方法的典型用法代码示例。如果您正苦于以下问题:C++ Projector::map方法的具体用法?C++ Projector::map怎么用?C++ Projector::map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Projector的用法示例。


在下文中一共展示了Projector::map方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: map

 uchar* map(float dstx, float dsty)
 {
   float sx = dstx*e1x + dsty*e1y;
   float sy = dstx*e2x + dsty*e2y;
   float dy = floor( sy / h + 0.5 );
   sy -= h*dy;
   sx += (L-offset)*dy;
   sx = sx / h * aspect * 2.0;
   sy = sy / h * aspect * 2.0;
   sx -= floor( sx/2.0 + 0.5 )*2.0;
   return child->map( sx, sy );
 }
开发者ID:vitroid,项目名称:Panojector,代码行数:12,代码来源:tile2.cpp

示例2: map

 uchar* map(float dstx, float dsty)
 {
   if ( dsty > 0.5 || dsty < -0.5 ){
     return 0;
   }
   //map coordinate to equirectangular coordinate
   float phi   = dstx * M_PI;
   float theta = dsty * M_PI;
   float x,y,z;
   spherical2cartesian(phi, theta, x,y,z );
   //swap
   float t;
   for(int i=0; i<nswap; i++){
     t = z;    z = -y;    y = x;    x = -t;
   }
   //recover angles
   cartesian2spherical(x,y,z, phi, theta);
   return child->map( phi / M_PI, theta / M_PI );
 }
开发者ID:vitroid,项目名称:Panojector,代码行数:19,代码来源:swap.cpp

示例3: map

 uchar* map(float dstx, float dsty)
 {
   float tx    = dstx;
   float ty    = 2.0*atan(exp(dsty*M_PI))/M_PI - 0.5;
   return child->map(tx,ty);
 }
开发者ID:vitroid,项目名称:Panojector,代码行数:6,代码来源:equ2mer.cpp

示例4: map

  uchar* map(float dstx, float dsty)
  {
    dsty += 1.0;
    int dan = (int)floor( dsty / bw);
    float loopwidth = bw * M_PI / 2.0;
    float danwidth = 2.0 - bw + loopwidth;
    float sx,sy;
    float h = bw / 2.0;
    if ( dan % 2 == 0 ){
      //even line
      sx = dan * danwidth + dstx;
      sy = dsty - dan*bw - h;
      //right end
      if ( dstx > 1.0 - h ){
	float delta = dstx - 1.0 + h;
	float a0 = asin( delta / h);
	float a1 = M_PI - a0;
	float c0 = cos(a0);
	float c1 = cos(a1);
	float y  = sy + 0.5*bw;
	float b0 = y - h*c0;
	float b1 = y - h*c1;
	a0 = a0 * h;
	if ( b1 < h ){
	  return 0;
	}
	else
	{
	  sx = sx - delta + a0;
	  sy -= h*(1.0-c0);
	}
      }
      //left end
      if ( dstx < -1.0 + h ){
	float delta = -(dstx + 1.0 - h);//width on the screen
	float a0 = asin( delta / h);
	float a1 = M_PI - a0; // width along the ribbon
	float c0 = cos(a0);
	float c1 = cos(a1);
	float y  = sy + h;
	float b0 = y - h*c0;
	float b1 = y - h*c1;
	//cout << delta << endl;
	a0 = a0 * h;
	a1 = a1 * h;
	if ( b0 > h ){
	  return 0;
	}
	else
	if ( b1 < h ){
	  //left; lower; turn
	  sx = sx + delta - a1;
	  sy += h*(1.0-c1);
	}
	else{
	  //left; lower
	  sx = sx + delta - a0;
	  sy += h*(1.0-c0);
	}
      }
    }
    else{
      //odd line
      sx = dan * danwidth - dstx;
      sy = dsty - dan * bw - 0.5*bw;
      //right end
      if ( dstx > 1.0 - h ){
	float delta = dstx - 1.0 + h;
	float a0 = asin( delta / h);
	float a1 = M_PI - a0;
	float c0 = cos(a0);
	float c1 = cos(a1);
	float y  = sy + 0.5*bw;
	float b0 = y  - h*c0;
	float b1 = y  - h*c1;
	a0 = a0 * h;
	a1 = a1 * h;
	if ( b0 > h ){
	  return 0;
	}
	else
	if ( b1 < h ){
	  //right; lower; turn
	  sx = sx + delta - a1;
	  sy += h*(1.0-c1);
	}
	else {
	  //right; lower end
	  sx = sx + delta - a0;
	  sy += h*(1.0-c0);
	}
      }
      //left end
      if ( dstx < -1.0 + h ){
	float delta = (dstx + 1.0 - h);
	float a0 = asin( delta / h);
	float a1 = M_PI - a0;
	float c0 = cos(a0);
	float c1 = cos(a1);
	float y  = sy + 0.5*bw;
//.........这里部分代码省略.........
开发者ID:vitroid,项目名称:Panojector,代码行数:101,代码来源:ribbon.cpp

示例5: map

 uchar* map(float dstx, float dsty)
 {
   return child->map(dstx+x,dsty+y);
 }
开发者ID:vitroid,项目名称:Panojector,代码行数:4,代码来源:slide.cpp


注:本文中的Projector::map方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。