當前位置: 首頁>>代碼示例>>Java>>正文


Java PLConstants.kPI方法代碼示例

本文整理匯總了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;
}
 
開發者ID:codedavid,項目名稱:PanoramaGL,代碼行數:31,代碼來源:PLHotspot.java

示例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;
}
 
開發者ID:marianmoldovan,項目名稱:panoramagl,代碼行數:31,代碼來源:PLHotspot.java


注:本文中的com.panoramagl.PLConstants.kPI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。