public ObjRenderData IntersectionGetRenderData1() { var obj = new ObjRenderData(); obj.AddLine(_uv1); return(obj); }
protected ObjRenderData GetControlGrid(List <List <Vector3> > verts) { var data = new ObjRenderData(); data.Vertices = verts.SelectMany(x => x).ToList(); var count = 0; for (int h = 0; h < verts.Count; h++) { var row = verts[h]; for (int w = 0; w < row.Count - 1; w++) { var idx = count + w; data.Edges.Add(new Edge(idx, idx + 1)); } count += row.Count; } count = 0; for (int h = 0; h < verts.Count - 1; h++) { var row = verts[h]; for (int w = 0; w < row.Count; w++) { var idx = count + w; data.Edges.Add(new Edge(idx, idx + row.Count)); } count += row.Count; } return(data); }
public ObjRenderData GetRenderData() { var obj = new ObjRenderData(); obj.AddLine(Verts); return(obj); }
private ObjRenderData GetGridForPatch(List <List <Vector3> > verts, int pIdxH, int pIdxW) { var data = new ObjRenderData(); var dh = DrawHeightCount; var pw = WidthPatchCount; for (int h = 0; h < dh; h++) { var tu = 1f * h / (dh - 1); for (int w = 0; w < pw; w++) { data.AddLine(GetWidthSegmentPrimitive(verts, pIdxH * 3, pIdxW * 3, tu)); } } var dw = DrawWidthCount; var ph = HeightPatchCount; for (int w = 0; w < dw; w++) { var tv = 1f * w / (dw - 1); for (int h = 0; h < ph; h++) { data.AddLine(GetHeightSegmentPrimitive(verts, pIdxW * 3, pIdxH * 3, tv)); } } return(data); }
public void Add(ObjRenderData data) { if (data != null) { Add(data.Vertices, data.Edges); } }
public ObjRenderData GetRenderData() { var verts = GetVerts(); var data = new ObjRenderData(); //polygon if (ShowPolygon && verts.Count > 1) { data.Vertices.AddRange(verts); data.Edges.AddRange(Enumerable.Range(0, verts.Count - 1).Select(x => new Edge(x, x + 1)).ToList()); } //curve int i; for (i = 0; i + 3 < verts.Count; i += 3) { data.Vertices.AddRange(GetSegment(verts, i, 4)); } var left = verts.Count - i; data.Vertices.AddRange(GetSegment(verts, i, left)); return(data); }
public ObjRenderData GetRenderData() { var renderData = new ObjRenderData(); renderData.Vertices = GetVertices(); renderData.Edges = GetEdges(); return(renderData); }
private void RenderIntersect(ObjRenderData data, int num) { foreach (var edge in data.Edges) { var vertA = data.Vertices[edge.IdxA].ToVector4(); var vertB = data.Vertices[edge.IdxB].ToVector4(); DrawIntersectionLine(vertA, vertB, num); } }
public ObjRenderData GetRenderData() { if (_dataChanged) { _renderData = new ObjRenderData(); _renderData.Vertices = GetVertices(); _renderData.Edges = GetEdges(); } return(_renderData); }
public ObjRenderData GetRenderData() { var verts = GetVerts(); var data = new ObjRenderData(); if (ShowControlGrid) { data.Add(GetControlGrid(verts)); } if (ShowGrid) { data.Add(GetGrid(verts)); } return(data); }
protected ObjRenderData GetGrid(List <List <Vector3> > verts) { var data = new ObjRenderData(); var H = HeightPatchCount; var W = WidthPatchCount; for (int h = 0; h < H; h++) { for (int w = 0; w < W; w++) { data.Add(GetGridForPatch(verts, h, w)); } } return(data); }
protected ObjRenderData GetGrid(List <List <Vector3> > verts) { var data = new ObjRenderData(); var dh = DrawHeightCount * HeightPatchCount; for (int h = 0; h < dh; h++) { var tu = 1f * h / (dh - 1); FillTmpW(verts, tu); data.AddLine(GetLine(_tmpW, _knotsW)); } var dw = DrawWidthCount * WidthPatchCount; for (int w = 0; w < dw; w++) { var tv = 1f * w / (dw - 1); FillTmpH(verts, tv); data.AddLine(GetLine(_tmpH, _knotsH)); } return(data); }