Ver Mensaje Individual
Antiguo 10 nov 2006   #7
HalfVector
H = E + L
 
Fecha de Ingreso: marzo-2004
Ubicación: Entre dos vectores
Mensajes: 877
Predeterminado Re: Lineas entre Puntos AutoUpdatada

Le he hecho unas cuantas modificaciones para que soporte un número de puntos arbitrario.

Código:
fn attachShapeToPoints points = (

	theShape = SplineShape()
	addNewSpline theShape
	for i = 1 to points.count do (
		addknot theShape 1 #corner #line points[i].pos
	)

	updateShape theShape

	local ctrlSource = "target.pos * (inverse owner.transform)"
	
	animateVertex theShape #all

	for i = 0 to (points.count - 1) do (
		local ctrl = Point3_Script()
		ctrl.addNode "target" points[i + 1]
		ctrl.addNode "owner" theShape
		ctrl.script = ctrlSource
		ctrl.update()
		theShape[4][8][i * 3 + 2].controller = ctrl
	)

	-- Comentar estas dos líneas si no se quiere congelar la spline
	theShape.showFrozenInGray = false
	freeze theShape
	
	OK
)
Por ejemplo puedes hacer que se cree una spline con todos los helpers de tipo "Point" que tengas en la escena:

Código:
attachShapeToPoints $Point*
Saludos.

PD: he hecho que la spline se congele para que la manipulación de los puntos sea más sencilla.

Última edición por HalfVector fecha: 10 nov 2006 a las 17:49.
HalfVector is offline   Responder Con Cita