Help me with a nudge in the right direction

Hi list,

I need to implement a morphing from one path to another path.

Situation.
Right now the I have a MemoryDC where I draw the image I need.
Upon mouse interaction (movement and wheel) I redraw the image as needed.

Separate from this interaction I need to animate a path, to change it from one position, shape and color to another position, shape and color and back again… about 3 or 4 times.

How should I approach this?

Any pointers are welcomed.

Thank you in advance.

Peter

···


There is NO FATE, we are the creators.

Peter Damoc wrote:

Hi list,

I need to implement a morphing from one path to another path.

Situation.
Right now the I have a MemoryDC where I draw the image I need.
Upon mouse interaction (movement and wheel) I redraw the image as needed.
Separate from this interaction I need to animate a path, to change it from one position, shape and color to another position, shape and color and back again... about 3 or 4 times.

How should I approach this?

Sounds like a timer would do fine. Each time the timer event happens just change to the next state of the animation and draw the new frame or call Refresh and let the paint handler do it. When the animation is done, stop the timer.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks Robin,

I’ve implemented a timer and the OnPaint handler seams to handle the updating rather well (no optimizations needed)

Now I need to understand how to handle the DrawSpline method in order for me to draw the thorax profile of a woman with big breasts…
Is there another way to draw that kind of a path? I need to draw it with wxPython because I also need to morph it (small breasts to big breasts)

Something like a DrawPath mimicking the d element parameter from the path element of SVG would be superb.

http://www.w3.org/TR/SVG11/paths.html

Peter

···

On 2/9/07, Robin Dunn < robin@alldunn.com> wrote:

Peter Damoc wrote:

Hi list,

I need to implement a morphing from one path to another path.

Situation.
Right now the I have a MemoryDC where I draw the image I need.
Upon mouse interaction (movement and wheel) I redraw the image as needed.
Separate from this interaction I need to animate a path, to change it

from one position, shape and color to another position, shape and color
and back again… about 3 or 4 times.

How should I approach this?

Sounds like a timer would do fine. Each time the timer event happens

just change to the next state of the animation and draw the new frame or
call Refresh and let the paint handler do it. When the animation is
done, stop the timer.


Robin Dunn
Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


There is NO FATE, we are the creators.

Peter Damoc wrote:

Thanks Robin,

I've implemented a timer and the OnPaint handler seams to handle the updating rather well (no optimizations needed)

Now I need to understand how to handle the DrawSpline method in order for me to draw the thorax profile of a woman with big breasts...
Is there another way to draw that kind of a path? I need to draw it with wxPython because I also need to morph it (small breasts to big breasts)

Something like a DrawPath mimicking the d element parameter from the path element of SVG would be superb.
Paths – SVG 1.1 (Second Edition)

Take a look at the new wx.GraphicsContext and wx.GraphicsPath classes.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Peter,

You may want to give FloatCanvas a look, it'll take care of a fair bit of the book keeping for you. Their is an old-ish version in wx.lib.floatcanvas, but there is a newer one with extra demos at:

http://www.mithis.com/~chrisb/

You can send questions to me or the floatcanvas list (preferred):

http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Now I need to understand how to handle the DrawSpline method in order for me to draw the thorax profile of a woman with big breasts...
Is there another way to draw that kind of a path? I need to draw it with wxPython because I also need to morph it (small breasts to big breasts)

With DCs, DrawSpline is about it. (and FloatCanvas has a Spline object)

Something like a DrawPath mimicking the d element parameter from the path element of SVG would be superb.
Paths – SVG 1.1 (Second Edition)

You might want to check out the new GraphicsContext -- I haven't used it yet, but it designed to provide more control over drawing that DCs, including path-based drawing.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Silly me… I did it again… Thanks Robin!

···

On 2/9/07, Robin Dunn robin@alldunn.com wrote:

Take a look at the new wx.GraphicsContext and wx.GraphicsPath classes.


There is NO FATE, we are the creators.

Hi Chris,

I’ve been meaning to take a look at FloatCanvas for some time… Looks like the opportunity arrived :wink:

Thanks,
Peter

···

On 2/9/07, Christopher Barker Chris.Barker@noaa.gov wrote:

Peter,

You may want to give FloatCanvas a look, it’ll take care of a fair bit
of the book keeping for you. Their is an old-ish version in
wx.lib.floatcanvas, but there is a newer one with extra demos at:

http://www.mithis.com/~chrisb/


There is NO FATE, we are the creators.