本文整理汇总了C#中System.Windows.Media.Media3D.Point3DCollection类的典型用法代码示例。如果您正苦于以下问题:C# Point3DCollection类的具体用法?C# Point3DCollection怎么用?C# Point3DCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Point3DCollection类属于System.Windows.Media.Media3D命名空间,在下文中一共展示了Point3DCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Generate
/// <summary>
/// Sets the coordinates of all the individual lines in the visual.
/// </summary>
/// <param name="args">
/// The <c>DependencyPropertyChangedEventArgs</c> object associated
/// with the property-changed event that resulted in this method
/// being called.
/// </param>
/// <param name="lines">
/// The <c>Point3DCollection</c> to be filled.
/// </param>
/// <remarks>
/// <para>
/// Classes that derive from <c>WireBase</c> override this
/// method to fill the <c>lines</c> collection.
/// It is custmary for implementations of this method to clear
/// the <c>lines</c> collection first before filling it.
/// Each pair of successive members of the <c>lines</c>
/// collection indicate one straight line.
/// </para>
/// <para>
/// The <c>WireLine</c> class implements this method by
/// clearing the <c>lines</c> collection and then adding
/// <c>Point1</c> and <c>Point2</c> to the collection.
/// </para>
/// </remarks>
protected override void Generate(DependencyPropertyChangedEventArgs args,
Point3DCollection lines)
{
lines.Clear();
lines.Add(Point1);
lines.Add(Point2);
}
开发者ID:samlcharreyron,项目名称:PedestrianTracker,代码行数:33,代码来源:WireLine.cs
示例2: FillMesh
public Point3DCollection FillMesh(int xVertices, int yVertices, double aspect)
{
LineEvaluator hLine = new LineEvaluator();
hLine.Point1 = new Point3D(-aspect/2, 0, 0);
hLine.Point2 = new Point3D(aspect/2, 0, 0);
LineEvaluator vLine = new LineEvaluator();
vLine.Point1 = new Point3D(0, 0.5, 0);
vLine.Point2 = new Point3D(0, -0.5, 0);
Point3DCollection positions = new Point3DCollection();
for (int y = 0; y < yVertices; y++)
{
double vT = (double) y/(yVertices - 1);
Point3D vPoint = vLine.Evaluate(vT);
for (int x = 0; x < xVertices; x++)
{
double hT = (double) x/(xVertices - 1);
Point3D hPoint = hLine.Evaluate(hT);
positions.Add(new Point3D(hPoint.X, vPoint.Y, 0));
}
}
return positions;
}
开发者ID:realsaraf,项目名称:eConcierge,代码行数:26,代码来源:RectangularMeshFiller.cs
示例3: CreateRectangle
public static MeshGeometry3D CreateRectangle(double height, double width)
{
var vertices = new Point3DCollection();
var normals = new Vector3DCollection();
var facets = new Int32Collection();
var textureCoords = new PointCollection();
vertices.Add(new Point3D(-width / 2, 0, -height / 2));
vertices.Add(new Point3D(-width / 2, 0, height / 2));
vertices.Add(new Point3D(width / 2, 0, -height / 2));
vertices.Add(new Point3D(width / 2, 0, height / 2));
normals.Add(new Vector3D(0, -1, 0));
normals.Add(new Vector3D(0, -1, 0));
normals.Add(new Vector3D(0, -1, 0));
normals.Add(new Vector3D(0, -1, 0));
textureCoords.Add(new Point(1,1));
textureCoords.Add(new Point(1, 0));
textureCoords.Add(new Point(0,1));
textureCoords.Add(new Point(0,0));
facets.Add(0); facets.Add(1); facets.Add(2); facets.Add(3); facets.Add(2); facets.Add(1);
var rectangle = new MeshGeometry3D();
rectangle.Positions = vertices;
rectangle.Normals = normals;
rectangle.TriangleIndices = facets;
rectangle.TextureCoordinates = textureCoords;
return rectangle;
}
开发者ID:MathiasBrannstrom,项目名称:SoundToColor,代码行数:29,代码来源:SimpleGeometry3D.cs
示例4: Triangulate
protected override void Triangulate(DependencyPropertyChangedEventArgs args,
Point3DCollection vertices,
Vector3DCollection normals,
Int32Collection indices,
PointCollection textures)
{
vertices.Clear();
normals.Clear();
indices.Clear();
textures.Clear();
MeshGeometry3D mesh = MeshGenerator.Geometry;
foreach (Point3D vertex in mesh.Positions)
vertices.Add(vertex);
foreach (Vector3D normal in mesh.Normals)
normals.Add(normal);
foreach (int index in mesh.TriangleIndices)
indices.Add(index);
foreach (Point texture in mesh.TextureCoordinates)
textures.Add(texture);
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:25,代码来源:ModelVisual.cs
示例5: ProcessFigure
protected override void ProcessFigure(CircularList<Point> list,
Point3DCollection vertices,
Vector3DCollection normals,
Int32Collection indices,
PointCollection textures)
{
int offset = vertices.Count;
for (int i = 0; i <= list.Count; i++)
{
Point pt = list[i];
// Set vertices.
vertices.Add(new Point3D(pt.X, pt.Y, 0));
vertices.Add(new Point3D(pt.X, pt.Y, -Depth));
// Set texture coordinates.
textures.Add(new Point((double)i / list.Count, 0));
textures.Add(new Point((double)i / list.Count, 1));
// Set triangle indices.
if (i < list.Count)
{
indices.Add(offset + i * 2 + 0);
indices.Add(offset + i * 2 + 2);
indices.Add(offset + i * 2 + 1);
indices.Add(offset + i * 2 + 1);
indices.Add(offset + i * 2 + 2);
indices.Add(offset + i * 2 + 3);
}
}
}
开发者ID:tianweidut,项目名称:3DMap,代码行数:33,代码来源:RibbonText.cs
示例6: receiveCurveFromMaya
public void receiveCurveFromMaya(string node_name, out Point3DCollection controlVertices, out List<double> weights, out List<double> knots, out int degree, out bool closed, out bool rational)
{
MPlug plLocal = getPlug(node_name, "local");
MObject oLocal = new MObject();
plLocal.getValue(oLocal);
MFnNurbsCurve nc = new MFnNurbsCurve(oLocal);
MPointArray p_aCVs = new MPointArray();
nc.getCVs(p_aCVs, MSpace.Space.kWorld);
controlVertices = new Point3DCollection();
weights = new List<double>();
foreach (MPoint p in p_aCVs)
{
controlVertices.Add(new Point3D(p.x, p.y, p.z));
weights.Add(1.0);
}
double min = 0, max = 0;
nc.getKnotDomain(ref min, ref max);
MDoubleArray d_aKnots = new MDoubleArray();
nc.getKnots(d_aKnots);
knots = new List<double>();
knots.Add(min);
foreach (double d in d_aKnots)
{
knots.Add(d);
}
knots.Add(max);
degree = nc.degree;
closed = nc.form == MFnNurbsCurve.Form.kClosed ? true : false;
rational = true;
}
开发者ID:MrWalsh,项目名称:DynaMaya-WIP,代码行数:35,代码来源:DynamoMayaService.cs
示例7: Generate
/// <summary>
///
/// </summary>
/// <param name="args"></param>
/// <param name="lines"></param>
protected override void Generate(DependencyPropertyChangedEventArgs args,
Point3DCollection lines)
{
Point3DCollection vertices = Positions;
Int32Collection indices = TriangleIndices;
lines.Clear();
if (vertices != null && vertices.Count > 0 &&
indices != null && indices.Count > 0)
{
// Check that this doesn't overflow !!!!!!
// -----------------------------------------
// Special logic if there are no indices !!!!
// -------------------------------------------
for (int i = 0; i < indices.Count; i += 3)
{
lines.Add(vertices[indices[i + 0]]);
lines.Add(vertices[indices[i + 1]]);
lines.Add(vertices[indices[i + 1]]);
lines.Add(vertices[indices[i + 2]]);
lines.Add(vertices[indices[i + 2]]);
lines.Add(vertices[indices[i + 0]]);
}
}
}
开发者ID:samlcharreyron,项目名称:PedestrianTracker,代码行数:35,代码来源:WireFrame.cs
示例8: AddCircleInZCross
private static void AddCircleInZCross(MeshBuilder mb, Point3D centre, double radius, int div)
{
var points = MeshBuilder.GetCircle(div);
var vectors = new Point3DCollection();
var normals = new Vector3DCollection();
var textures = new PointCollection();
vectors.Add(new Point3D(centre.X, centre.Y, 0));
normals.Add(new Vector3D(0, 0, 1));
textures.Add(new Point(0.5, 0.5));
for (int i = 0; i < points.Count - 1; i++)
{
vectors.Add(new Point3D(points[i].X * radius + centre.X, points[i].Y * radius + centre.Y, centre.Z));
normals.Add(new Vector3D(0, 0, -1));
textures.Add(new Point(points[i].X * 0.5 + 0.5, points[i].Y * 0.5 + 0.5));
vectors.Add(new Point3D(points[i + 1].X * radius + centre.X, points[i + 1].Y * radius + centre.Y, centre.Z));
normals.Add(new Vector3D(0, 0, 01));
textures.Add(new Point(points[i + 1].X * 0.5 + 0.5, points[i + 1].Y * 0.5 + 0.5));
}
mb.AddTriangleFan(vectors, normals, textures);
}
开发者ID:woodxiang,项目名称:WpfApplication2,代码行数:25,代码来源:TestModelVisual3D.cs
示例9: Point3DCollection
/* internal void drawLine(Point3D start, Point3D pt, bool hit)
{
TubeVisual3D line;
lines.TryGetValue(start, out line);
if (line != null)
{
this.Children.Remove(line);
lines.Remove(start);
}
Point3DCollection contours = new Point3DCollection();
contours.Add(ToWorld(start));
contours.Add(ToWorld(pt));
line = new TubeVisual3D { Diameter = 0.5, Path = contours, Fill = Brushes.SandyBrown };
lines.Add(start,line);
this.Children.Add(line);
addBox(start);
if(hit) addBox(pt);
}
*/
internal void drawLine(Point3D start, Point3D end)
{
TubeVisual3D line;
lines.TryGetValue(start, out line);
if (line != null)
{
this.Children.Remove(line);
lines.Remove(start);
}
Point3DCollection contours = new Point3DCollection();
contours.Add(ToWorld(start));
contours.Add(ToWorld(end));
line = new TubeVisual3D { Diameter = 0.3, Path = contours, Fill = Brushes.DarkOliveGreen};
lines.Add(start, line);
this.Children.Add(line);
string x = string.Format("{0:0.00}",end.X);
string y = string.Format("{0:0.00}", end.Y);
string z = string.Format("{0:0.00}", end.Z);
string text = x + "," + y + "," + z;
addBox(start);
addBox(end);
add3DText(end, text);
}
开发者ID:sivarajankumar,项目名称:dentalsmile,代码行数:47,代码来源:MeasurementContainer.cs
示例10: OnNumberOfSidesChanged
private static void OnNumberOfSidesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
WheelMesh wheel = (WheelMesh)d;
Point3DCollection points = new Point3DCollection(3 + wheel.NumberOfSides - 2);
Int32Collection triangles = new Int32Collection(wheel.NumberOfSides);
// Center
points.Add(new Point3D(wheel.Radius, wheel.Radius, wheel.Height));
// Top
points.Add(new Point3D(wheel.Radius, 0, 0));
for (int i = 1; i < wheel.NumberOfSides; i++)
{
double beta = 2 * Math.PI / wheel.NumberOfSides * i;
double alpha = (Math.PI - beta) / 2;
double length = 2 * wheel.Radius * Math.Sin(beta / 2);
double x = length * Math.Cos(Math.PI / 2 - alpha);
double y = length * Math.Sin(Math.PI / 2 - alpha);
points.Add(new Point3D(wheel.Radius + x, y, 0));
triangles.Add(0);
triangles.Add(i);
triangles.Add(i+1);
}
triangles.Add(0);
triangles.Add(wheel.NumberOfSides);
triangles.Add(1);
wheel.SetValue(PointsProperty, points);
wheel.SetValue(TriangleIndicesProperty, triangles);
}
开发者ID:mkandroid15,项目名称:Samples,代码行数:32,代码来源:WheelMesh.cs
示例11: Triangulate
protected override void Triangulate(
DependencyPropertyChangedEventArgs args,
Point3DCollection vertices,
Vector3DCollection normals,
Int32Collection indices,
PointCollection textures)
{
// Clear all four collections.
vertices.Clear();
normals.Clear();
indices.Clear();
textures.Clear();
// Convert TextGeometry to series of closed polylines.
PathGeometry path =
TextGeometry.GetFlattenedPathGeometry(0.001,
ToleranceType.Relative);
foreach (PathFigure fig in path.Figures)
{
list.Clear();
list.Add(fig.StartPoint);
foreach (PathSegment seg in fig.Segments)
{
if (seg is LineSegment)
{
LineSegment lineseg = seg as LineSegment;
list.Add(lineseg.Point);
}
else if (seg is PolyLineSegment)
{
PolyLineSegment polyline = seg as PolyLineSegment;
for (int i = 0; i < polyline.Points.Count; i++)
list.Add(polyline.Points[i]);
}
}
// Figure is complete. Post-processing follows.
if (list.Count > 0)
{
// Remove last point if it's the same as the first.
if (list[0] == list[list.Count - 1])
list.RemoveAt(list.Count - 1);
// Convert points to Y increasing up.
for (int i = 0; i < list.Count; i++)
{
Point pt = list[i];
pt.Y = 2 * Origin.Y - pt.Y;
list[i] = pt;
}
// For each figure, process the points.
ProcessFigure(list, vertices, normals, indices, textures);
}
}
}
开发者ID:tianweidut,项目名称:3DMap,代码行数:60,代码来源:GeometryTextBase.cs
示例12: Generate
/// <summary>
/// Sets the coordinates of all the individual lines in the visual.
/// </summary>
/// <param name="args">
/// The <c>DependencyPropertyChangedEventArgs</c> object associated
/// with the property-changed event that resulted in this method
/// being called.
/// </param>
/// <param name="lines">
/// The <c>Point3DCollection</c> to be filled.
/// </param>
/// <remarks>
/// <para>
/// Classes that derive from <c>WireBase</c> override this
/// method to fill the <c>lines</c> collection.
/// It is custmary for implementations of this method to clear
/// the <c>lines</c> collection first before filling it.
/// Each pair of successive members of the <c>lines</c>
/// collection indicate one straight line.
/// </para>
/// </remarks>
protected override void Generate(DependencyPropertyChangedEventArgs args,
Point3DCollection lines)
{
lines.Clear();
if (Data == null)
return;
Transform3D xform = Data.Transform;
foreach (PathFigure3D fig in Data.Figures)
{
PathFigure3D figFlattened = fig.GetFlattenedPathFigure();
Point3D pointStart = xform.Transform(figFlattened.StartPoint);
foreach (PathSegment3D seg in figFlattened.Segments)
{
PolyLineSegment3D segPoly = seg as PolyLineSegment3D;
for (int i = 0; i < segPoly.Points.Count; i++)
{
lines.Add(pointStart);
Point3D point = xform.Transform(segPoly.Points[i]);
lines.Add(point);
pointStart = point;
}
}
}
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:50,代码来源:WirePath.cs
示例13: PlaneModel
public PlaneModel(GeometryModel3D plane, Color planeColor, Point3DCollection points)
{
this.plane = plane;
this.planeColor = planeColor;
this.points = points;
this.crosses = 0;
}
开发者ID:kuninagakura,项目名称:SpaceDivider,代码行数:7,代码来源:PlaneModel.cs
示例14: Generate
/// <summary>
/// Sets the coordinates of all the individual lines in the visual.
/// </summary>
/// <param name="args">
/// The <c>DependencyPropertyChangedEventArgs</c> object associated
/// with the property-changed event that resulted in this method
/// being called.
/// </param>
/// <param name="lines">
/// The <c>Point3DCollection</c> to be filled.
/// </param>
/// <remarks>
/// <para>
/// Classes that derive from <c>WireBase</c> override this
/// method to fill the <c>lines</c> collection.
/// It is custmary for implementations of this method to clear
/// the <c>lines</c> collection first before filling it.
/// Each pair of successive members of the <c>lines</c>
/// collection indicate one straight line.
/// </para>
/// <para>
/// The <c>WireLines</c> class implements this method by
/// clearing the <c>lines</c> collection and then copying
/// its own <c>Lines</c> collection to it.
/// </para>
/// </remarks>
protected override void Generate(DependencyPropertyChangedEventArgs args,
Point3DCollection lines)
{
lines.Clear();
foreach (Point3D point in Lines)
lines.Add(point);
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:34,代码来源:WireLines.cs
示例15: CreateModel
private void CreateModel()
{
var points = new Point3DCollection();
var edges = new Int32Collection();
var triangles = new Int32Collection();
switch (CurrentModelType)
{
case ModelTypes.StellatedOctahedron:
case ModelTypes.Tetrahedron:
points.Add(+1, +1, +1);
points.Add(-1, -1, 1);
points.Add(-1, +1, -1);
points.Add(+1, -1, -1);
edges.Add(0, 1, 1, 2, 2, 0, 0, 3, 1, 3, 2, 3);
triangles.Add(0, 1, 2, 0, 3, 1, 1, 3, 2, 2, 3, 0);
break;
}
switch (CurrentModelType)
{
case ModelTypes.StellatedOctahedron:
// http://en.wikipedia.org/wiki/Compound_of_two_tetrahedra
points.Add(-1, +1, +1);
points.Add(1, -1, 1);
points.Add(1, +1, -1);
points.Add(-1, -1, -1);
edges.Add(4, 5, 5, 6, 6, 4, 4, 7, 5, 7, 6, 7);
triangles.Add(4, 5, 6, 4, 7, 5, 5, 7, 6, 6, 7, 4);
break;
}
var m = new Model3DGroup();
// Add the nodes
var gm = new MeshBuilder();
foreach (var p in points)
{
gm.AddSphere(p, 0.1);
}
m.Children.Add(new GeometryModel3D(gm.ToMesh(), Materials.Gold));
// Add the triangles
var tm = new MeshBuilder();
for (int i = 0; i < triangles.Count; i += 3)
{
tm.AddTriangle(points[triangles[i]], points[triangles[i + 1]], points[triangles[i + 2]]);
}
m.Children.Add(new GeometryModel3D(tm.ToMesh(), Materials.Red) { BackMaterial = Materials.Blue });
// Add the edges
var em = new MeshBuilder();
for (int i = 0; i < edges.Count; i += 2)
{
em.AddCylinder(points[edges[i]], points[edges[i + 1]], 0.08, 10);
}
m.Children.Add(new GeometryModel3D(em.ToMesh(), Materials.Gray));
Model = m;
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:58,代码来源:MainViewModel.xaml.cs
示例16: GenerateVertices
public Point3DCollection GenerateVertices() {
Point3DCollection points=new Point3DCollection();
Point3D point;
for(int i=0;i<VertexNormals.Count;i++) {
point=new Point3D(VertexNormals[i].Vertex.X,VertexNormals[i].Vertex.Y,VertexNormals[i].Vertex.Z);
points.Add(point);
}
return points;
}
开发者ID:mnisl,项目名称:OD,代码行数:9,代码来源:D3Object.cs
示例17: RenderDescription
public RenderDescription()
{
points = new Point3DCollection();
lines = new Point3DCollection();
meshes = new List<Mesh3D>();
xAxisPoints = new Point3DCollection();
yAxisPoints = new Point3DCollection();
zAxisPoints = new Point3DCollection();
}
开发者ID:epeter61,项目名称:Dynamo,代码行数:9,代码来源:dynIDrawable.cs
示例18: GetPointCollection
public static Point3DCollection GetPointCollection(List<XbimPoint3D> points)
{
var ret = new Point3DCollection(points.Count);
foreach (var enumPoint in points)
{
ret.Add(new Point3D(enumPoint.X, enumPoint.Y, enumPoint.Z));
}
return ret;
}
开发者ID:tnesser,项目名称:XbimWindowsUI,代码行数:9,代码来源:GeomUtils.cs
示例19: CreatePath
private Point3DCollection CreatePath(double min, double max, int n, Func<double, double> fx, Func<double, double> fy, Func<double, double> fz)
{
var list = new Point3DCollection(n);
for (int i = 0; i < n; i++)
{
double u = min + (max - min) * i / n;
list.Add(new Point3D(fx(u), fy(u), fz(u)));
}
return list;
}
开发者ID:ORRNY66,项目名称:helix-toolkit,代码行数:10,代码来源:MainWindow.xaml.cs
示例20: MeshBuilder
/// <summary>
/// Initializes a new instance of the <see cref="MeshBuilder"/> class.
/// </summary>
/// <param name="generateNormals">generate normals</param>
/// <param name="generateTextureCoordinates">generate texture coordinates</param>
public MeshBuilder(bool generateNormals, bool generateTextureCoordinates)
{
positions = new Point3DCollection();
triangleIndices = new Int32Collection();
if (generateNormals)
normals = new Vector3DCollection();
if (generateTextureCoordinates)
textureCoordinates = new PointCollection();
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:15,代码来源:MeshBuilder.cs
注:本文中的System.Windows.Media.Media3D.Point3DCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论