本文整理汇总了Java中com.panoramagl.PLConstants.kPI方法的典型用法代码示例。如果您正苦于以下问题:Java PLConstants.kPI方法的具体用法?Java PLConstants.kPI怎么用?Java PLConstants.kPI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.panoramagl.PLConstants
的用法示例。
在下文中一共展示了PLConstants.kPI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculatePoints
import com.panoramagl.PLConstants; //导入方法依赖的package包/类
protected List<PLPosition> calculatePoints(GL10 gl)
{
List<PLPosition> result = new ArrayList<PLPosition>(4);
//1
PLPosition pos = this.convertPitchAndYawToPosition(mAtv, mAth), pos1 = this.convertPitchAndYawToPosition(mAtv + 0.0001f, mAth);
//2 and 3
PLVector3 p1 = new PLVector3(pos.x, pos.y, pos.z),
p2p1 = new PLVector3(0.0f, 0.0f, 0.0f).sub(p1),
r = p2p1.crossProduct(new PLVector3(pos1.x, pos1.y, pos1.z).sub(p1)),
s = p2p1.crossProduct(r);
//4
r.normalize();
s.normalize();
//5.1
float w = mWidth * PLConstants.kPanoramaRadius, h = mHeight * PLConstants.kPanoramaRadius;
float radius = FloatMath.sqrt((w * w) + (h * h));
//5.2
float angle = (float)Math.asin(h / radius);
//5.3
PLVector3 n = new PLVector3(0.0f, 0.0f, 0.0f);
for(float theta : new float[]{ PLConstants.kPI - angle, angle, PLConstants.kPI + angle, 2 * PLConstants.kPI - angle})
{
n.x = p1.x + (radius * FloatMath.cos(theta) * r.x) + (radius * FloatMath.sin(theta) * s.x);
n.y = p1.y + (radius * FloatMath.cos(theta) * r.y) + (radius * FloatMath.sin(theta) * s.y);
n.z = p1.z + (radius * FloatMath.cos(theta) * r.z) + (radius * FloatMath.sin(theta) * s.z);
n.normalize();
result.add(PLPosition.PLPositionMake(n.x, n.y, n.z));
}
return result;
}
示例2: calculatePoints
import com.panoramagl.PLConstants; //导入方法依赖的package包/类
protected List<PLPosition> calculatePoints(GL10 gl)
{
List<PLPosition> result = new ArrayList<PLPosition>(4);
//1
PLPosition pos = this.convertPitchAndYawToPosition(mAtv, mAth), pos1 = this.convertPitchAndYawToPosition(mAtv + 0.0001f, mAth);
//2 and 3
PLVector3 p1 = new PLVector3(pos.x, pos.y, pos.z),
p2p1 = new PLVector3(0.0f, 0.0f, 0.0f).sub(p1),
r = p2p1.crossProduct(new PLVector3(pos1.x, pos1.y, pos1.z).sub(p1)),
s = p2p1.crossProduct(r);
//4
r.normalize();
s.normalize();
//5.1
float w = mWidth * PLConstants.kPanoramaRadius, h = mHeight * PLConstants.kPanoramaRadius;
float radius = (float)Math.sqrt((w * w) + (h * h));
//5.2
float angle = (float)Math.asin(h / radius);
//5.3
PLVector3 n = new PLVector3(0.0f, 0.0f, 0.0f);
for(float theta : new float[]{ PLConstants.kPI - angle, angle, PLConstants.kPI + angle, 2 * PLConstants.kPI - angle})
{
n.x = p1.x + (radius * (float)Math.cos(theta) * r.x) + (radius * (float)Math.sin(theta) * s.x);
n.y = p1.y + (radius * (float)Math.cos(theta) * r.y) + (radius * (float)Math.sin(theta) * s.y);
n.z = p1.z + (radius * (float)Math.cos(theta) * r.z) + (radius * (float)Math.sin(theta) * s.z);
n.normalize();
result.add(PLPosition.PLPositionMake(n.x, n.y, n.z));
}
return result;
}