Sign in to follow this  
OgbobeBuko

Simple Animation

Recommended Posts

Hi guys
i have a challenge on animation ..... i have not been able to find good tutorial on animation....what i want to be able to achieve is like connecting two pieces together(like a bolt and a nut)....something like an assembly...show the models translating through the scene until they are connected while also rotating the camera and represent it as an animation....

please do you have an idea how i could do this ....or where i could get nice animation tutorials in opengl


thanks

Share this post


Link to post
Share on other sites
[quote name='GottiJay' timestamp='1311281467' post='4838644']
Hi guys
i have a challenge on animation ..... i have not been able to find good tutorial on animation....what i want to be able to achieve is like connecting two pieces together(like a bolt and a nut)....something like an assembly...show the models translating through the scene until they are connected while also rotating the camera and represent it as an animation....

please do you have an idea how i could do this ....or where i could get nice animation tutorials in opengl


thanks
[/quote]


You are loosely describing hierarchical transformations, but I also detect an interest in constraints. Given your level of experience, let's just worry about the former. Make sure that you have a good background in linear algebra (matrices, vectors) before [url="http://www.gamespp.com/tutorials/matrixTransformationTutorial08.html"]attempting this[/url].

Share this post


Link to post
Share on other sites
It sounds like you need a scenegraph to handly the relationship between objects in your scene. If you parent one object to the other, then you will be able to move object 1 and have object 2 move with it. At this point, having the second rotate wrt the first is very easy since you are no longer working wrt the global coordinate system.

Share this post


Link to post
Share on other sites

[b][url="../../user/185702-gottijay/"]@GottiJay[/url][/b]

[b] please tell which application using for your graphics. if u use 3Dsmax u draw the components and use the camera..
[/b]

Share this post


Link to post
Share on other sites
Assuming we're speaking of a programmatic solution here...

The desired animation is a time driven function of a couple of positions and orientations (and perhaps other features), i.e. it is a-priorily known at what position each object is located at and what orientation it has at any moment in time during the animation run.

The order in which features like position and orientation are applied to an object is not arbitrary. You may need to use 4 single transformations already to specify the position (by a translation w.r.t. the origin) and orientation (e.g. by 3 Euler rotations w.r.t. the identity basis) of an object. You have to understand that every single transformation step is changing the co-ordinate frame.

After determining a fine transformation pipeline for an object, understand some or all of the single transformation matrices as a variable for which the value is dependent on time. Compute the single variable values by using a timeline mechanism. This may by a time driven formula; e.g. if you want to roll (i.e. z axis rotation) the screw from 30° to 90° in-between t[sub]1[/sub] and t[sub]2[/sub], then
r(t) := toRad(30) + toRad(90-30) * ( t - t1 ) / ( t2 - t1 )
would do the job by computing the roll angle if time t is in the defined interval. You can also use curves (e.g. splines) to define features over time, and you can also use key-framing and interpolation, of course.

However, the clue is to have all features defined as absolute values for the time of animation. Then, when running the animation, compute the particular values of each transformation variable, compute the transformation matrices from them, compute the overall transformation matrix for each object, and apply it to the belonging object. Use the current moment in time (relative to the beginning of the animation) to determine the correct formula/curve/keyframes from the timeline for each individual variable.

Controlling the camera is not different from controlling an object, assuming that the camera is integrated into the world as any "normal" object is. Scene graphs usually provide hierarchical transformations, but are invented to solve any and all problems by a single hierarchical containment. IMHO dealing with scene graphs here is needlessly complicated, not to mention that scene graphs are an relict that should be avoided nowadays.

Share this post


Link to post
Share on other sites
Doesn't sound like you need to program this. If you're doing this in 3D, you could make all the models in Blender and then just use keyframe animations. It sounds like more of an animation than a program. Or does it have to be done in OpenGL?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this