forked from bonvision/BonVision
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added animation article, minor fixs to other articles
- Loading branch information
Showing
5 changed files
with
133 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# Animating Stimuli | ||
## Under Construction | ||
|
||
## Manipulating Parameters of Drawing Stimuli Nodes. | ||
Basic animation in `BonVision` involves manipulating one or more properties in a `DrawX` node. For instance, to make a circle | ||
move across the screen, you would vary the `LocationX` parameter in a `DrawCircle` node. | ||
|
||
To get started: | ||
1) Right click on any `DrawX` node and externalize the property you want to manipulate. | ||
2) `BonVision` provides a `RangeAnimation` operator to generate a linear range of values for a specified duration of time. Connect a `RangeAnimation` operator to the parameter you externalized and change the `RangeBegin`, `RangeEnd` and `Duration`. | ||
3) Add a `Repeat` operator if you want the animation to repeat between the `RangeAnimation` and `DrawX` node. | ||
|
||
The workflow will look something like this (which shows a circle moving across the screen repeatedly) | ||
|
||
:::workflow | ||
![Create Window](../workflows/animating-stimuli-circle-locationx.bonsai) | ||
::: | ||
|
||
> [!Note] | ||
> The `RangeBegin` and `RangeEnd` parameter depends on the [drawing region](drawing-region.md). For a `NormalizedView` -1 to 1 represents the edges of the screen. | ||
> [!Note] | ||
> To vary more than 1 parameter at a time if they share the same `RangeAnimation` parameters, you can externalize more than 1 property at a time and they will be grouped together. | ||
> To prevent parameters from being grouped together, connect a `RangeAnimation` operator to the first externalized property before externalizing a second property. | ||
<div style="max-width: 500px"> | ||
<iframe width=100% height=282 src="https://www.youtube.com/embed/YUNJNsJj6co" title="BonVision quick tips: Making a animated feature" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> | ||
</div> | ||
|
||
For an additional example of this, see the `Looming/Sweeping` demo in the [Demo](/demos/VR-demo.md) page. | ||
|
||
|
||
## Animating stimuli with moving viewing window/perspective view | ||
- this sounds like it should be possible but I need to look at an example. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<WorkflowBuilder Version="2.8.1" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:gl="clr-namespace:Bonsai.Shaders;assembly=Bonsai.Shaders" | ||
xmlns:res="clr-namespace:Bonsai.Resources;assembly=Bonsai.System" | ||
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core" | ||
xmlns="https://bonsai-rx.org/2018/workflow"> | ||
<Workflow> | ||
<Nodes> | ||
<Expression xsi:type="Combinator"> | ||
<Combinator xsi:type="gl:CreateWindow"> | ||
<gl:Width>640</gl:Width> | ||
<gl:Height>480</gl:Height> | ||
<gl:VSync>On</gl:VSync> | ||
<gl:SwapSync>false</gl:SwapSync> | ||
<gl:ClearColor>Gray</gl:ClearColor> | ||
<gl:ClearMask>DepthBufferBit ColorBufferBit</gl:ClearMask> | ||
<gl:CursorVisible>true</gl:CursorVisible> | ||
<gl:Location xsi:nil="true" /> | ||
<gl:WindowBorder>Resizable</gl:WindowBorder> | ||
<gl:WindowState>Normal</gl:WindowState> | ||
<gl:DisplayDevice>Primary</gl:DisplayDevice> | ||
<gl:TargetRenderFrequency>60</gl:TargetRenderFrequency> | ||
<gl:TargetUpdateFrequency xsi:nil="true" /> | ||
<gl:RenderState /> | ||
<gl:GraphicsMode> | ||
<gl:ColorFormat> | ||
<gl:Red>8</gl:Red> | ||
<gl:Green>8</gl:Green> | ||
<gl:Blue>8</gl:Blue> | ||
<gl:Alpha>8</gl:Alpha> | ||
</gl:ColorFormat> | ||
<gl:Depth>16</gl:Depth> | ||
<gl:Stencil>0</gl:Stencil> | ||
<gl:Samples>0</gl:Samples> | ||
<gl:AccumulatorFormat> | ||
<gl:Red>0</gl:Red> | ||
<gl:Green>0</gl:Green> | ||
<gl:Blue>0</gl:Blue> | ||
<gl:Alpha>0</gl:Alpha> | ||
</gl:AccumulatorFormat> | ||
<gl:Buffers>2</gl:Buffers> | ||
<gl:Stereo>false</gl:Stereo> | ||
</gl:GraphicsMode> | ||
</Combinator> | ||
</Expression> | ||
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Primitives.BonVisionResources.bonsai" /> | ||
<Expression xsi:type="Combinator"> | ||
<Combinator xsi:type="res:LoadResources" /> | ||
</Expression> | ||
<Expression xsi:type="Combinator"> | ||
<Combinator xsi:type="gl:RenderFrame" /> | ||
</Expression> | ||
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Environment.NormalizedView.bonsai" /> | ||
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Primitives.RangeAnimation.bonsai"> | ||
<Duration>4</Duration> | ||
<RangeBegin>-1</RangeBegin> | ||
<RangeEnd>1</RangeEnd> | ||
</Expression> | ||
<Expression xsi:type="Combinator"> | ||
<Combinator xsi:type="rx:Repeat" /> | ||
</Expression> | ||
<Expression xsi:type="PropertyMapping"> | ||
<PropertyMappings> | ||
<Property Name="LocationX" /> | ||
</PropertyMappings> | ||
</Expression> | ||
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Primitives.DrawCircle.bonsai"> | ||
<Diameter>0.5</Diameter> | ||
<LocationX>-0.7916667</LocationX> | ||
<LocationY>0</LocationY> | ||
<Layer>0</Layer> | ||
<ColorR>0</ColorR> | ||
<ColorG>0</ColorG> | ||
<ColorB>0</ColorB> | ||
<ColorA>1</ColorA> | ||
</Expression> | ||
</Nodes> | ||
<Edges> | ||
<Edge From="0" To="1" Label="Source1" /> | ||
<Edge From="1" To="2" Label="Source1" /> | ||
<Edge From="3" To="4" Label="Source1" /> | ||
<Edge From="4" To="8" Label="Source1" /> | ||
<Edge From="5" To="6" Label="Source1" /> | ||
<Edge From="6" To="7" Label="Source1" /> | ||
<Edge From="7" To="8" Label="Source2" /> | ||
</Edges> | ||
</Workflow> | ||
</WorkflowBuilder> |