Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi.

I'd like to know if is it possible to make a path using graphics that objects would be following the path.

For example supposing that I draw a circle is it possible to make another object follow the circle's border like an orbit ?

I know that this is possible if I there is a function that retrieves each pixel from a graphic type (path), this way I can set the following object center to be that retrieved pixel. So the question would be more if a function like that exists or not.

I don't want to use only circles to make the patch but any graphic object like triangles, lines, etc...

Any help ?

Thanks

hey please take a look at this topic :)

hey please take a look at this topic :)

newbrew wrote:hey please take a look at this topic :)
All you need to do is calculate an array of pixel positions based on the
screen dimensions, etc. Then simply run through this array as a
list of samples just like any other kind of animation.

newbrew wrote:hey please take a look at this topic :)
All you need to do is calculate an array of pixel positions based on the
screen dimensions, etc. Then simply run through this array as a
list of samples just like any other kind of animation.

jmiller2 wrote:All you need to do is calculate an array of pixel positions based on the
screen dimensions, etc. Then simply run through this array as a
list of samples just like any other kind of animation.
If I understood what you said that's not what I want.
Basically I want to retrieve the pixels used by a geometric form.
For example, if I draw a curve on screen, is there a way to get each pixel position (x,y) of this curve ? If so, what do I need in order to get them ?
Thanks.

jmiller2 wrote:All you need to do is calculate an array of pixel positions based on the
screen dimensions, etc. Then simply run through this array as a
list of samples just like any other kind of animation.
If I understood what you said that's not what I want.
Basically I want to retrieve the pixels used by a geometric form.
For example, if I draw a curve on screen, is there a way to get each pixel position (x,y) of this curve ? If so, what do I need in order to get them ?
Thanks.

please someone help me with that.

please someone help me with that.

Could you give us more detail?
From what I understood: you'll draw a curve on the screen and want to get the (x,y), right? So, suppose you're drawing a parabola, y=x*x. Then, for any "x" you have, it's straightforward to calculate the "y".
Same goes for other curves, lines, circles, ... .
And as jmiller said, you can precalc this curve and store your data in an array.
I'm sorry if I didn't understand your question, please give us more details.

Could you give us more detail?
From what I understood: you'll draw a curve on the screen and want to get the (x,y), right? So, suppose you're drawing a parabola, y=x*x. Then, for any "x" you have, it's straightforward to calculate the "y".
Same goes for other curves, lines, circles, ... .
And as jmiller said, you can precalc this curve and store your data in an array.
I'm sorry if I didn't understand your question, please give us more details.

bulach wrote:Could you give us more detail?
From what I understood: you'll draw a curve on the screen and want to get the (x,y), right? So, suppose you're drawing a parabola, y=x*x. Then, for any "x" you have, it's straightforward to calculate the "y".
Same goes for other curves, lines, circles, ... .
And as jmiller said, you can precalc this curve and store your data in an array.
I'm sorry if I didn't understand your question, please give us more details.
It works but I don't want to recalculate the values once calculated by the BREW function which creates the curve or any geometric form.
For example, when you create a curve BREW calculates "behind the cast" each pixel position that must be filled to give us an impression of a curve, these pixels are probably stored somewhere and this is what I want to know. This can be seen by displaying the IGraphics, when you display it, a sequence of pixels are drawn on screen.
Having access to these pixels I don't need to use a formula like y=ax^2+bx+c (curve) to recalculate each pixel again, I just walk throught this array or whatever it is and associate to the moving object the same coordinates of each stored pixel.
I hope I was more explenative...
Thank you.

bulach wrote:Could you give us more detail?
From what I understood: you'll draw a curve on the screen and want to get the (x,y), right? So, suppose you're drawing a parabola, y=x*x. Then, for any "x" you have, it's straightforward to calculate the "y".
Same goes for other curves, lines, circles, ... .
And as jmiller said, you can precalc this curve and store your data in an array.
I'm sorry if I didn't understand your question, please give us more details.
It works but I don't want to recalculate the values once calculated by the BREW function which creates the curve or any geometric form.
For example, when you create a curve BREW calculates "behind the cast" each pixel position that must be filled to give us an impression of a curve, these pixels are probably stored somewhere and this is what I want to know. This can be seen by displaying the IGraphics, when you display it, a sequence of pixels are drawn on screen.
Having access to these pixels I don't need to use a formula like y=ax^2+bx+c (curve) to recalculate each pixel again, I just walk throught this array or whatever it is and associate to the moving object the same coordinates of each stored pixel.
I hope I was more explenative...
Thank you.

I think I don't understand you yet, sorry... :)
Who will draw on IGRAPHICS this points? Well, if you're drawing it, then you have the values for the coordinates, right? So, just store them in an array, or whatever structure that suits you....
If you want to simply access the pixels from an image to check what color is a given pixel, then you'll probably want to to access the data part of a bitmap, or use something like IBITMAP_GetPixel().

I think I don't understand you yet, sorry... :)
Who will draw on IGRAPHICS this points? Well, if you're drawing it, then you have the values for the coordinates, right? So, just store them in an array, or whatever structure that suits you....
If you want to simply access the pixels from an image to check what color is a given pixel, then you'll probably want to to access the data part of a bitmap, or use something like IBITMAP_GetPixel().

bulach wrote:I think I don't understand you yet, sorry... :)
Who will draw on IGRAPHICS this points? Well, if you're drawing it, then you have the values for the coordinates, right? So, just store them in an array, or whatever structure that suits you....
If you want to simply access the pixels from an image to check what color is a given pixel, then you'll probably want to to access the data part of a bitmap, or use something like IBITMAP_GetPixel().
BREW will store the pixels inside the IGraphics (at least I think that is the way it works) when you use IGRAPHICS_DrawArc(IGraphics * pIGraphics, AEEArc * pArc).
Then after the IGraphics interface is filled by this function I want to retrieve the pixel information from it.

bulach wrote:I think I don't understand you yet, sorry... :)
Who will draw on IGRAPHICS this points? Well, if you're drawing it, then you have the values for the coordinates, right? So, just store them in an array, or whatever structure that suits you....
If you want to simply access the pixels from an image to check what color is a given pixel, then you'll probably want to to access the data part of a bitmap, or use something like IBITMAP_GetPixel().
BREW will store the pixels inside the IGraphics (at least I think that is the way it works) when you use IGRAPHICS_DrawArc(IGraphics * pIGraphics, AEEArc * pArc).
Then after the IGraphics interface is filled by this function I want to retrieve the pixel information from it.

I think the pixels will be "stored" in the display. Then you could get IDISPLAY_GetDeviceBitmap, then IBITMAP_GetPixel....
But how are you going to know what pixels are part of the arc you've just drawn?

I think the pixels will be "stored" in the display. Then you could get IDISPLAY_GetDeviceBitmap, then IBITMAP_GetPixel....
But how are you going to know what pixels are part of the arc you've just drawn?

bulach wrote:I think the pixels will be "stored" in the display. Then you could get IDISPLAY_GetDeviceBitmap, then IBITMAP_GetPixel....
But how are you going to know what pixels are part of the arc you've just drawn?
That's what I want to know...
But I think that they are stored separated...because when you don't draw the IGraphic they don't show...so I think they are stored inside the IGraphics...
If so, I won't have to distinguish.

bulach wrote:I think the pixels will be "stored" in the display. Then you could get IDISPLAY_GetDeviceBitmap, then IBITMAP_GetPixel....
But how are you going to know what pixels are part of the arc you've just drawn?
That's what I want to know...
But I think that they are stored separated...because when you don't draw the IGraphic they don't show...so I think they are stored inside the IGraphics...
If so, I won't have to distinguish.

Stored? I believe there is usually a back buffer to which the pixels are immediately rendered, and then the back buffer is copied to the screen when you do an update. Otherwise, graphics commands may be queued, but doing that at the pixel level would be pretty inefficient.
In any case, these pixel coordinate are probably not quite what you want. You don't actually want to move one pixel at a time, do you?
Most likely you'll want to get a parametric form of the equation for the path you want to follow and animate with that. y in terms of x isn't right if you need linear motion along the path and using actual pixel data has the same problem.

Stored? I believe there is usually a back buffer to which the pixels are immediately rendered, and then the back buffer is copied to the screen when you do an update. Otherwise, graphics commands may be queued, but doing that at the pixel level would be pretty inefficient.
In any case, these pixel coordinate are probably not quite what you want. You don't actually want to move one pixel at a time, do you?
Most likely you'll want to get a parametric form of the equation for the path you want to follow and animate with that. y in terms of x isn't right if you need linear motion along the path and using actual pixel data has the same problem.

I really don't understand what you're trying to do... :)
As rabidcow said, the easiest way would be to get the formula for whatever kind of curve you're following, and that's it.. If you don't want to recalculate it every time, precalc the points you need and store them.

I really don't understand what you're trying to do... :)
As rabidcow said, the easiest way would be to get the formula for whatever kind of curve you're following, and that's it.. If you don't want to recalculate it every time, precalc the points you need and store them.

newbrew wrote:BREW will store the pixels inside the IGraphics (at least I think that is the way it works) when you use IGRAPHICS_DrawArc(IGraphics * pIGraphics, AEEArc * pArc).
Then after the IGraphics interface is filled by this function I want to retrieve the pixel information from it.
That's not the way it works. When you call IGRAPHICS_DrawArc(), the IGraphics object will calculate where the pixels should appear and draws the arc on the display. But it doesn't store the pixel locations.
-Erik

newbrew wrote:BREW will store the pixels inside the IGraphics (at least I think that is the way it works) when you use IGRAPHICS_DrawArc(IGraphics * pIGraphics, AEEArc * pArc).
Then after the IGraphics interface is filled by this function I want to retrieve the pixel information from it.
That's not the way it works. When you call IGRAPHICS_DrawArc(), the IGraphics object will calculate where the pixels should appear and draws the arc on the display. But it doesn't store the pixel locations.
-Erik