I want to share with you a new animation, but this time, what is moving is you!
Little video: Tour Camera
Quick start guide:
Download the model here
Open it, switch to "Perspective View", toggle the visibility of one of the sketches called "track..", select one line of the sketch and paste this code:
Code: Select all
from pivy import coin import time from FreeCAD import Base cam = FreeCADGui.ActiveDocument.ActiveView.getCameraNode() trajectory = Gui.Selection.getSelectionEx().Object.Shape.Edges for edge in trajectory: startPoint = edge.valueAt( 0.0 ) endPoint = edge.valueAt( edge.Length ) dirVector = ( endPoint - startPoint ).normalize() currentPoint = startPoint while (currentPoint - startPoint).Length < edge.Length: currentPoint = currentPoint + dirVector cam.position.setValue(currentPoint + Base.Vector( 0,0, 10) ) cam.pointAt( coin.SbVec3f( endPoint, endPoint, endPoint+10) , coin.SbVec3f( 0, 0, 1 ) ) Gui.updateGui() time.sleep(0.005)
P.D.: I've already posted this at the FreeCAD google+ page, but I don't know up to which point is connected with the forum, if this feels like spam, please tell me and I will post only here or there