Jump to content

Picture Animation question


Recommended Posts

Hi,

I am trying to simulate a vehicle moving on a map. In this project I use picture frame to draw the map and the vehicle. What I want is the position of the vehicle is updated and redrawn continuously without redrawing the whole map. Currently my vehicle is just a point. I would like to know if there is anyway I can erase the old point and draw a new point without redraw a whole picture? For furture extension, is there anyway I can do that with an object like a circle or a rectangle?

Thanks,

Link to comment

QUOTE (Thang Nguyen @ Oct 28 2008, 08:08 AM)

Hi,

I am trying to simulate a vehicle moving on a map. In this project I use picture frame to draw the map and the vehicle. What I want is the position of the vehicle is updated and redrawn continuously without redrawing the whole map. Currently my vehicle is just a point. I would like to know if there is anyway I can erase the old point and draw a new point without redraw a whole picture? For furture extension, is there anyway I can do that with an object like a circle or a rectangle?

Thanks,

I normally use picture control, i quicky wrote an example to show you how to do this. Basically i have 2 picture controls in this example, 1 for the map and

1 for the object obviously. I loaded them when the program started, so only need to load 'em once. I use state machine with event design partern as the structure of my program. This example shows that you can move the object around the map by calculating the new Origin (x,y) - relative to the front panel,

and write to the Origin property node of the object.

It would me much better and easier if you use GOOP to design as you can classify all of your different objs and their properties: for example: object name, color, components, position, size, transparency level, etc...

If have time i recommend you to have a look at Endevo GOOP tool from Mikael, it's awsome.

Good luck

Link to comment

The 2D picture control cannot do what you're asking for. The 3D picture control can.

Take a look in the palettes at

Functions>>Programming>>Graphics & Sound>>3D Picture Control

The 3D API is simply a much more modern API than the 2D API. You can draw 2D pictures with the 3D API. I know no more details than that... check the online help and the shipping examples for more info.

Link to comment

QUOTE (Aristos Queue @ Oct 28 2008, 11:23 AM)

The 2D picture control cannot do what you're asking for. The 3D picture control can.

Take a look in the palettes at

Functions>>Programming>>Graphics & Sound>>3D Picture Control

The 3D API is simply a much more modern API than the 2D API. You can draw 2D pictures with the 3D API. I know no more details than that... check the online help and the shipping examples for more info.

Can you post an example AQ, I dont get it :headbang:

I did look at couple of examples that come with LV for 3D picture control, do we really need this for this kind of simulation that Thang wants to create?

Regards,

Link to comment

QUOTE (Minh Pham @ Oct 27 2008, 06:39 PM)

I normally use picture control, i quicky wrote an example to show you how to do this. Basically i have 2 picture controls in this example, 1 for the map and

1 for the object obviously. I loaded them when the program started, so only need to load 'em once. I use state machine with event design partern as the structure of my program. This example shows that you can move the object around the map by calculating the new Origin (x,y) - relative to the front panel,

and write to the Origin property node of the object.

It would me much better and easier if you use GOOP to design as you can classify all of your different objs and their properties: for example: object name, color, components, position, size, transparency level, etc...

If have time i recommend you to have a look at Endevo GOOP tool from Mikael, it's awsome.

Good luck

@ Minh: Thank you for your recommendation. What I am talking about is the picture of the vehicle is drawn in the same picture frame with the map. I did talk about that I am using a pixel. But I think it's a good idea to use 2 picture controls. I just wonder if I put the second picture control overlap the 1st picture control and using the transparent color, I don't know if I can still catch the event with the 1st picture control or not. I will try with it. About the OOP, I also had some experience with them. I used GOOP Developer of SciWare and LVOOP . But sometime, in some projects, I think it will be too complicated to use them.

@Aristos: Currently my project is only 2D. But maybe in the future I have to work with Altitude, so 3D will be used in the next step. Currently it's overkill for my project. Thank you for your suggestion anyway. :thumbup:

@Philip: It's maybe a worth try. I have never thought about this. Wow. But we cannot do much change with this solution I guess.

Link to comment

There is an alternative (quick and dirty) way to achieve this without delving into OOP.

You could customise a control (boolean, dial etc), set the disabled property to 1 to prevent anything happening when the user clicks on it then simply change the control's position on the screen according to your needs.

I have included a simple VI to demonstrate what I mean. I used a ring control so that you can even rotate the car to head in the direction it is traveling !!

This may be too simple for what you need, but it certainly is quick to implement.

Cheers & Beers

:thumbup: :beer:

Link to comment

QUOTE (Phil Duncan @ Oct 30 2008, 11:42 PM)

There is an alternative (quick and dirty) way to achieve this without delving into OOP.

You could customise a control (boolean, dial etc), set the disabled property to 1 to prevent anything happening when the user clicks on it then simply change the control's position on the screen according to your needs.

I have included a simple VI to demonstrate what I mean. I used a ring control so that you can even rotate the car to head in the direction it is traveling !!

This may be too simple for what you need, but it certainly is quick to implement.

Cheers & Beers

:thumbup: :beer:

LOL, it's cool.

I am using two picture control now.

Thanks.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.