Gets the Model3DGroup for frameNo

Namespace:  Ab3d
Assembly:  Ab3d.Reader3ds (in Ab3d.Reader3ds)
Version: 4.2.0.0 (4.2.0.0)

Syntax

C#
public Model3DGroup GetFrame(
	int frameNo,
	Viewport3D viewport
)
Visual Basic (Declaration)
Public Function GetFrame ( _
	frameNo As Integer, _
	viewport As Viewport3D _
) As Model3DGroup
Visual C++
public:
Model3DGroup^ GetFrame(
	int frameNo, 
	Viewport3D^ viewport
)

Parameters

frameNo
Type: System..::.Int32
frameNo
viewport
Type: System.Windows.Controls..::.Viewport3D
viewport where the Model3DGroup is shown

Return Value

returns the Model3DGroup for frameNo

Remarks

The Reader3ds can also read the animation data from a 3ds file. It is possible to get the Model3DGroup object for each frame.
Note: Do not expect too much from this version - currently only simple animations are supported. Camera and light animation is not supported (you can move the object instead). Also only simple linear interpolation is used to calculate the data between key frames. Be careful with rotation - because angle interpolation is used changes of rotation axis is not supported.

Examples

First you have to create a new instance of Reader3ds, read the file and than you can use the GetFrame method:
CopyC#
Reader3ds newReader3ds;
newReader3ds = new Reader3ds();
newReader3ds.ReadFile("c:\\models\\simple_animation.3ds");

for (int frameNo=0; frameNo<newReader3ds.FramesCount; frameNo++)
{
    newReader3ds.GetFrame(frameNo, Viewport1);
    System.Threading.Thread.Sleep(250); // 4 frames per second
}

See Also