private Vector3[] GetInterpolatedFilterPositions() { int filterNumGridShape = Mathf.CeilToInt(Mathf.Sqrt(filterNum)); Vector3[] gridPositions = GridShape.ScaledUnitGrid(filterNumGridShape, filterNumGridShape, Vector3.zero, spacing.x); Vector3[] linePositions = LineShape.ScaledUnitLine(filterNum, Vector3.zero, new Vector3(1, 0, 0), spacing.x); Vector3[] filterPositions = Shape.InterpolateShapes(linePositions, gridPositions, 1.0f); // TOFO: Maybe integrate lineToGrid parameter, but for now only grid return(filterPositions); }
private Vector3[] GetInterpolatedFilterPositions() { int reducedDepthGridShape = Mathf.CeilToInt(Mathf.Sqrt(depth)); Vector3[] xLinePositions = LineShape.ScaledUnitLine(depth, new Vector3(0, 0, 0), new Vector3(1, 0, 0), spread); Vector3[] zLinePositions = LineShape.ScaledUnitLine(depth, new Vector3(0, 0, 0), new Vector3(0, 0, 1), spread); Vector3[] filterPositions = Shape.InterpolateShapes(xLinePositions, zLinePositions, xToZ); return(filterPositions); }
private void UpdateFeatureMaps() { if (_featureMaps == null) { InitFeatureMaps(); return; } int reducedDepthGridShape = Mathf.CeilToInt(Mathf.Sqrt(depth)); Vector3[] xLinePositions = LineShape.ScaledUnitLine(depth, new Vector3(0, 0, 0), new Vector3(1, 0, 0), spread); Vector3[] zLinePositions = LineShape.ScaledUnitLine(depth, new Vector3(0, 0, 0), new Vector3(0, 0, 1), spread); Vector3[] filterPositions = Shape.InterpolateShapes(xLinePositions, zLinePositions, xToZ); for (int i = 0; i < _featureMaps.Count; i++) { _featureMaps[i].UpdateValues(this); } }
/// <summary> /// Calculates the position of the nodes according to parameters. /// </summary> /// <returns></returns> protected Vector3[] GetInterpolatedNodePositions() { int reducedDepthGridShape = Mathf.CeilToInt(Mathf.Sqrt(reducedDepth)); Vector3[] gridPositions = GridShape.ScaledUnitGrid(reducedDepthGridShape, reducedDepthGridShape, new Vector3(0, 0, 0), filterSpread); Vector3[] linePositionsX = LineShape.ScaledUnitLine(reducedDepth, new Vector3(0, 0, 0), new Vector3(1, 0, 0), filterSpread * (reducedDepthGridShape / (float)reducedDepth)); Vector3[] linePositionsZ = LineShape.ScaledUnitLine(reducedDepth, new Vector3(0, 0, 0), new Vector3(0, 0, 1), filterSpread * (reducedDepthGridShape / (float)reducedDepth)); Vector3[] linePositions = Shape.InterpolateShapes(linePositionsX, linePositionsZ, lineXToZ); Vector3[] circlePositions = CircleShape.ScaledUnitCircle(reducedDepth, new Vector3(0, 0, 0), filterSpread); Vector3[] filterPositions = null; if (lineCircleGrid < 1.0f) { filterPositions = Shape.InterpolateShapes(linePositions, circlePositions, lineCircleGrid); } else if (lineCircleGrid <= 2.0f) { filterPositions = Shape.InterpolateShapes(circlePositions, gridPositions, lineCircleGrid - 1.0f); } return(filterPositions); }