本文整理匯總了C#中Sharp3D.Math.Core.Vector3D.z方法的典型用法代碼示例。如果您正苦於以下問題:C# Vector3D.z方法的具體用法?C# Vector3D.z怎麽用?C# Vector3D.z使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sharp3D.Math.Core.Vector3D
的用法示例。
在下文中一共展示了Vector3D.z方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: process
protected virtual FragmentList process(Feature input, FilterEnv env)
{
FragmentList output;
// the text string:
string text;
if (getTextScript() != null)
{
ScriptResult r = env.getScriptEngine().run(getTextScript(), input, env);
if (r.isValid())
text = r.asString();
else
env.getReport().error(r.asString());
}
// resolve the size:
double font_size = 16.0;
if (getFontSizeScript() != null)
{
ScriptResult r = env.getScriptEngine().run(getFontSizeScript(), input, env);
if (r.isValid())
font_size = r.asDouble(font_size);
else
env.getReport().error(r.asString());
}
// the text color:
Vector4D color = getColorForFeature(input, env);
// calculate the 3D centroid of the feature:
// TODO: move this to the geoshapelist class
Vector3D point = new Vector3D(input.getExtent().getCentroid());
ZCalc zc;
input.getShapes().accept(zc);
point.z() = zc.z_count > 0 ? zc.z_sum / (double)zc.z_count : 0.0;
// build the drawable:
osgText.Text t = new osgText.Text();
t.setAutoRotateToScreen(true);
t.setCharacterSizeMode(osgText.Text.SCREEN_COORDS);
t.setAlignment(osgText.Text.CENTER_CENTER);
t.setText(text.c_str());
t.setColor(color);
t.setCharacterSize((float)font_size);
t.setPosition(point);
t.setBackdropType(osgText.Text.OUTLINE);
t.setBackdropColor(osg.Vec4(0, 0, 0, 1));
#if PENDING
// testing the flat-label approach here:
osg.Matrix cell2map = env.getInputSRS().getInverseReferenceFrame();
osg.Vec3d feature_center = point * cell2map;
feature_center.normalize();
osg.Vec3d cell_center = osg.Vec3d(0,0,1) * cell2map;
cell_center.normalize();
osg.Quat q;
q.makeRotate( cell_center, feature_center );
t.setRotation( q );
t.setAutoRotateToScreen( false );
// end of flat label approach
#endif
if (font.valid())
{
t.setFont(font.get());
}
if (getDisableDepthTest())
{
t.getOrCreateStateSet().setAttribute(new osg.Depth(osg.Depth.ALWAYS, 0, 1, false), osg.StateAttribute.ON);
}
output.Add(new Fragment(t));
return output;
}