void UpdateFunctionTransition() { FunctionLibrary.Function from = FunctionLibrary.GetFunction(transitionFunction), to = FunctionLibrary.GetFunction(function); float progress = duration / transitionDuration; float time = Time.time; float step = 2f / resolution; float v = 0.5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (x == resolution) { x = 0; z += 1; v = (z + 0.5f) * step - 1f; } float u = (x + 0.5f) * step - 1f; points[i].localPosition = FunctionLibrary.Morph( u, v, time, from, to, progress ) * range; } }
void UpdateFunctionTransition() { FunctionLibrary.Function from = FunctionLibrary.GetFunction(transitionFunction), to = FunctionLibrary.GetFunction(function); float progress = duration / transitionDuration; float time = Time.time; float step = 2f / resolution; // uv space added so that we're not confined in 3 coordinates (Sphere, Torus) float v = 0.5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (x == resolution) { x = 0; z += 1; v = (z + 0.5f) * step - 1f; } float u = (x + 0.5f) * step - 1f; points[i].localPosition = FunctionLibrary.Morph( u, v, time, from, to, progress ); } }
void Update() { FunctionLibrary.Function f = FunctionLibrary.GetFunction(function); float time = Time.time; for (int i = 0; i < points.Length; i++) { Transform point = points[i]; Vector3 position = point.localPosition; if (Invert == 0) { position.x += (speed * Time.deltaTime); } else { position.x -= (speed * Time.deltaTime); } position.y = f(position.x, time); point.localPosition = position; } }
private void AnimatingGraph() { FunctionLibrary.Function f = FunctionLibrary.GetFunction(functions); float time = Time.time; for (int i = 0; i < points.Length; i++) { Transform point = points[i]; Vector3 position = point.localPosition; point.localPosition = position; } }
private void Update() { // the function and current time FunctionLibrary.Function f = FunctionLibrary.GetFunction(function); float time = Time.time; // Animating Points for (int i = 0; i < points.Length; i++) { Transform point = points[i]; Vector3 position = point.localPosition; position.y = f(position.x, time); point.localPosition = position; } }
private void UpdateFunction() { FunctionLibrary.Function function = FunctionLibrary.GetFunction(targetFunction); float time = Time.time; int index = 0; float step = 2.0f / resolution; for (int x = 0; x != resolution; ++x) { for (int z = 0; z != resolution; ++z) { float u = (x + 0.5f) * step - 1f; float v = (z + 0.5f) * step - 1f; points[index++].localPosition = function(u, v, time); } } }
void UpdateFunction() { FunctionLibrary.Function f = FunctionLibrary.GetFunction(function); float time = Time.time; float step = 2f / resolution; float v = 0.5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (x == resolution) { x = 0; z += 1; v = (z + 0.5f) * step - 1f; } float u = (x + 0.5f) * step - 1f; points[i].localPosition = f(u, v, time); } }
void UpdateFunction() { FunctionLibrary.Function func = FunctionLibrary.GetFunction(functionName); float t = Time.time; float step = 2f / resolution; float v = .5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (resolution == x) { x = 0; z += 1; v = (z + .5f) * step - 1f; } float u = (x + .5f) * step - 1f; points[i].localPosition = func(u, v, t); } }
private void UpdateFunctionTransition() { FunctionLibrary.Function from = FunctionLibrary.GetFunction(transitionFunction); FunctionLibrary.Function to = FunctionLibrary.GetFunction(targetFunction); float progress = duration / transitionDuration; float time = Time.time; int index = 0; float step = 2.0f / resolution; for (int x = 0; x != resolution; ++x) { for (int z = 0; z != resolution; ++z) { float u = (x + 0.5f) * step - 1f; float v = (z + 0.5f) * step - 1f; points[index++].localPosition = FunctionLibrary.Morph(u, v, time, from, to, progress); } } }
void UpdateFunction() { // delegate based on enum selection FunctionLibrary.Function f = FunctionLibrary.GetFunction(function); float time = Time.time; float step = 2f / resolution; // uv space added so that we're not confined in 3 coordinates (Sphere, Torus) float v = 0.5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (x == resolution) { x = 0; z += 1; v = (z + 0.5f) * step - 1f; } float u = (x + 0.5f) * step - 1f; points[i].localPosition = f(u, v, time); } }
void UpdateFunctionTransition() { FunctionLibrary.Function from = FunctionLibrary.GetFunction(transitionFromFunc); FunctionLibrary.Function to = FunctionLibrary.GetFunction(functionName); float progress = duration / transitionDuration; float t = Time.time; float step = 2f / resolution; float v = .5f * step - 1f; for (int i = 0, x = 0, z = 0; i < points.Length; i++, x++) { if (resolution == x) { x = 0; z += 1; v = (z + .5f) * step - 1f; } float u = (x + .5f) * step - 1f; points[i].localPosition = FunctionLibrary.Morph(u, v, t, from, to, progress); } }