## Visio Animation Template

Started by vojo, September 22, 2008, 12:42:18 PM

0 Members and 1 Guest are viewing this topic.

#### vojo

Very nice.....the intriguing piece of this is the rotating of the plane....Can you post the source for this?
Curious about the 3D to 2D translation

#### cliff50

Vogo, the demo of the rotating 3D plane is actually three seperate pages. one page is the "graphics engine" with two circles  "pan" and "tilt"  the other two pages are foreground and background. the background page accomadates the "slab" on a layer(which which can be toggled visible\invisible) .. if you watch carefully at the beginning you will also see a faint grey large "X".. these are the "cross hairs"  (essentially just lines) whose angles and rotation formulas are dependent on the "pan tilt" circles..  sounds convoluted  .. yes it was. .. the slab (i think) was glued to the ends of the cross hairs

I will see if I can find some of the source code for you in the near future

#### cliff50

Quote from: vojo on April 11, 2011, 08:14:14 PM
Very nice.....the intriguing piece of this is the rotating of the plane....Can you post the source for this?
Curious about the 3D to 2D translation

Public Sub PanLeft()
Dim twist As Double

If ActiveWindow.page = "Page-125" Or ActiveWindow.page = "Background-4" Then
twist = 0.001
HaltRotation = Not HaltRotation 'toggle the HaltRotation rotation
enclosure.Cells("Geometry1.NoShow") = True
For I = 1 To 1000
Plan.Cells("angle") = Plan.Cells("angle") - twist
PanAngle.Formula = Plan.Cells("angle").Formula
If twist < 0.05 Then
twist = twist + twist
End If
DoEvents
If HaltRotation Then
Exit For
End If
Next
End If

#### cliff50

Quote from: vojo on April 11, 2011, 08:14:14 PM
Very nice.....the intriguing piece of this is the rotating of the plane....Can you post the source for this?
Curious about the 3D to 2D translation

Public Sub TiltUp()
Dim twist As Double

If ActiveWindow.page = "Page-125" Or ActiveWindow.page = "Background-4" Then
twist = 0.001
HaltRotation = Not HaltRotation
enclosure.Cells("Geometry1.NoShow") = True
For I = 1 To 1000
Profile.Cells("angle") = Profile.Cells("angle") - twist
If twist < 0.05 Then
twist = twist + twist
End If
If Profile.Cells("angle") < -1.5707963269998 Then
Profile.Cells("angle") = -1.5707963269998
Exit For
End If
TiltAngle.Formula = Profile.Cells("angle").Formula
DoEvents
If HaltRotation Then
Exit For
End If
Next
TiltAngle.Formula = Profile.Cells("angle").Formula
End If

#### cliff50

#34
Quote from: vojo on April 11, 2011, 08:14:14 PM
Very nice.....the intriguing piece of this is the rotating of the plane....Can you post the source for this?
Curious about the 3D to 2D translation

Vojo, not sure if I can send the lot as there are many sub routines  but maybe you can get some idea from these. sorry I cant be more elaborate. I dont want to inundate the blog.
Cheers!

ratiox = (90 - (Atn(tempx / tempy) * (180 / 3.1415926535898))) & " deg"
ratioy = (90 + (Atn(tempx / tempy) * (180 / 3.1415926535898))) & " deg"
location.Cells("PinX").FormulaForce = "ThePage!PageWidth/2+(" & xcord & " mm*(COS(ThePage!Prop.PanAngle -  " & ratiox & ")))"
location.Cells("PinY").FormulaForce = "ThePage!PageHeight/2-(" & ycord & " mm*(-SIN(ThePage!Prop.PanAngle + " & ratioy & "))*-SIN(ThePage!Prop.TiltAngle))"

#### vojo

np..thx

More interested in the geometry cells of the "table" that rotates.

Playiing with angles just makes the shape rotate on the plane parallel to the computer screen

In the geometry cells, author must be doing some 3D to 2D translations

#### Visio Guy

My guess is that the "rotation" becomes and exercise in building rhombi, essentially skewing the rectangle to varying degrees.

The math for maintaining a point along a line from side to side is then fairly simple algebra which can be done in the ShapeSheet with only minor hair-pulling.

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

#### vojo

Sure...simple algebra....but translating that into visio geometry where the angles involved are really cos(omega)*sin(gamma) + sin(omega)*cos(gama) are needed to define where the vertexs go is not simple

Ie if its a fixed rombus or games played with width or height to trick the ....that is simple and fair enough....but to rotate, the trig comes into play.

I need to study June's latest...he may have licked the problem I am curious about

#### cliff50

Guys its been two years or more since I did this, trying to think back and explain the mechanism in your context is my problem though.
I will look deeper into it , but the "trick" is to have the cross hairs ( the grey faint "X") that you see at the begining of the video. the table top is pinned\ glued to the 4 outside end points of the cross hairs.

the 4 X "skirts" of the rotating plane appear and disappear depending on whether their start extremity is more left (or more right) than their end extremity).

the trig maths generated by the out-of-sight "graphic engine" adjusts the angles of the "cross hairs"

I dont think its distorting a stationary rectangle in this context, also the blue dots\ green lines  are "injected" into their shapeshhet formulas  so that their PIN X PIN Y can track a "oval" trajectory ...the X Y axis of this ovaloid trajectory is influenced again by referencing the the out-of-sight "graphic engine"

The custom controls "PAN LEFT , PAN RIGHT, TILT UP, TILT DOWN, DEFAULT  and XENITH  use VBA macros to drive the "graphic engine".

I remember my issue at the time was trying to figure out how to have a fade to horizon convergence point which would give it even more realism. But this scope for this ran dry.

#### cliff50

snapshots of the graphic engine and the crosshairs shapesheet formulas

#### cliff50

sorry ..and this one

#### lysakowski

I am attempting to get this exampe working in Visio 2013.  No luck.    The controls at the bottom of the drawing do nothing.