LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie in picture animation!

Hi !
 
I am trying to make a simulation which needs an animated picture.. or let's say, that whole thing is the animated picture ..
I've searched the forum .. all topics around are abit advanced ..
 
i'll clarify ,
 
For a start, and to learn, I want to simulate a pendulum, a simple one consists of a ball and a mass-less cord( so it doesnt get in the calculations )..
The point is that I need the animation to react with the change of variables ( cord length will change the period for example )..
I tried the pic ring, but i dont see it happening that way ..
I have the development suit but couldnt find the picture control toolkit ..
 
please direct me to a tutorial or something if possible..
 
Many thanks.
Moh
 
 
 
 
 
0 Kudos
Message 1 of 8
(3,308 Views)
Hi Moh,
I find my Picture- VIs in the palette "Programming/Graphics&Sound/Picture functions". I work with the Prof.-Development System and I think the picture functions are not delivered with the simple development system.
Another good approach is the "Find examples..." in your Help-menu.
Hope this helps,
Dave
Greets, Dave
Message 2 of 8
(3,299 Views)
Yes Dave, I have those VIs .. but I need examples to see what's the possibility to do my job ..
The "Find example" thing has 2 examples , not useful in my case.
 
Thanks
Moh
0 Kudos
Message 3 of 8
(3,281 Views)
Hi Moh,
I made a simple example, just to get started. What I find very useful is the VI "robot.vi" in "Find examples". If you need advice in calculating the coordinates of your animation, you should have a look at the trigonometrically functions.
Dave
Greets, Dave
Message 4 of 8
(3,275 Views)
Hey Dave,
Unfortunately, I am running on version 7, so I couldnt open your file.[ I have version 8, but too lazy to install it Smiley Wink ]
 
I looked at the picture- VIs .. I could do some animation like the pendulum in the attached VI . Have a look if you want
 
Many thanks Dave.

Message Edited by Moh on 04-26-2006 07:18 AM

0 Kudos
Message 5 of 8
(3,267 Views)

animating a model can be done with the picture control and a state machine.  A simple 30 frames per second can be achieved by

1. get  tick 0 (get clock count).

2. update the model (physics based calculation) ie position of pendulum at model time (can be clock for soft realtime simulations or a simulated clock)

3. Draw the model (for a pendulum this is easy, draw cord is draw line from origin to bob center from calculation and draw bob which is a simple draw circle where the diameter is proportional to the mass)

4.  Get tick 1 if tick 1 -tick 0 > 1/30sec wait the difference. no sense updating faster than 30Hz

 

Paul

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 8
(3,260 Views)

Thanks Paul,

The big deal is in step no. 3 . For a simple pendulum, yes, it is easy ... it needs some calculations to determine the x and y coordinates of the ball and the end point of the cord. the cord has constant length.

more complicated work is on the way 🙂

Moh

0 Kudos
Message 7 of 8
(3,256 Views)

Modeling of 2-d structures are not very difficult, essentially you will have 2 common methods for transforming objects, rototion and translation which are accomplished using simple matrix math and have been discussed on this forum before.  One additional transformation is applise globally which I find useful is to translate the world coortinated by .5 screen height and .5 screen width and a scale which is simple units_of_measurment/max(pixels_screen_height, pixels_screen width).  this is a very simplified version of what a rendering engine does interms of vertex rendering in 2-d.  Remember all objects can be represented py polygons (arrays of verticies) which have been transformed through scale rotation and translation.  3-d is much more complicated but still doable (I would look into the opengl toolkits).

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 8
(3,246 Views)