Discusiones sobre Productos NI

cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

ANIMACION DE CIRCULO EN XY GRAPH

¡Resuelto!
Ir a solución

Hola, necesito de su ayuda, me dejaron de tarea hacer un programa en el que el usuario controle el movimiento de un circulo dentro de la grafica xy, que el usuario pueda elegir hacia donde se mueve el circulo (derecha, izquierda, arriba o abajo), y que dicho circulo este creado con seno y coseno, y no se como hacerlo.

El archivo es un ejemplo de lo que debemos hacer, en el el circulo se mueve únicamente en diagonal. 

Agradecería su ayuda y saludos a toda la comunidad. 

 

0 kudos
Mensaje 1 de 4
1.761 Vistas

Way too much code! here's a quick example to draw a circle at a given posittion. (There is no need for sine and cosine, and if you need both, there is also this function!).

 

To move the ball [up down left right] as controlled by the user, you need four buttons, one for each direction. Keep the xy position in a shift register and increment/decrement x or y depending on which button is held down. Not shown.

 

Attached is quick rewrite how to draw a circle. Now implement the idea with the four buttons.

 

altenbach_0-1621409074265.png

 

Mensaje 2 de 4
1.706 Vistas
Solución
Aceptado por dominguez0987

@altenbach wrote:

To move the ball [up down left right] as controlled by the user, you need four buttons, one for each direction. Keep the xy position in a shift register and increment/decrement x or y depending on which button is held down.


Here is how that could look like (direction buttons are switch until released):

 

altenbach_0-1621445671430.png

 

Mensaje 3 de 4
1.676 Vistas

Muchas gracias, saludos 

0 kudos
Mensaje 4 de 4
1.632 Vistas