}
void Update(){
//reset texture if it has changed:
if( xture != image ){
xture = image;
}
//nothing needs to be recalculated if distance hasn't changed or a move/rotate was attempted on billboard moved withoutour permission:
if(distance == prevDistance &&
on == prevPosition &&
ulerAngles == prevRotation
) return;
//error for attempting a backdrop placement beyond camera's far clip plane:
if(distance > pPlane){
or("Backdrop's distance is further than the camera's far clip plane. Extend the camera's far clip plane orreduce the billboard's distance.");
return;
}
//error for attempting a backdrop placement before camera's near clip plane:
if(distance < ipPlane){
or("Backdrop's distance is closer than the camera's near clip plane. Extend the distance or reduce thecamera's near clip plane.");
return;
}
//set backdrop's placement:
on = d * distance;
//calculate mesh:
es = CalcVerts();
ulateNormals();
//readjust comparison values:
prevDistance = distance;
prevPosition = on;
prevRotation = ulerAngles;
}
Vector3[] CalcVerts()
{
return new Vector3[] {
eTransformPoint(ToWorldPoint(new Vector3(0,0,distance))),
eTransformPoint(ToWorldPoint(new Vector3(,0,distance))),
eTransformPoint(ToWorldPoint(new Vector3(0,,distance))),
eTransformPoint(ToWorldPoint(newVector3(,,distance)))
};
}
}
本文发布于:2024-09-22 09:36:03,感谢您对本站的认可!
本文链接:https://www.17tex.com/fanyi/53107.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |