You can subscribe to this list here.
2002 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}
(2) 
_{Jul}
(24) 
_{Aug}
(23) 
_{Sep}
(15) 
_{Oct}
(6) 
_{Nov}
(52) 
_{Dec}
(48) 

2003 
_{Jan}
(169) 
_{Feb}
(110) 
_{Mar}
(90) 
_{Apr}
(123) 
_{May}
(254) 
_{Jun}
(243) 
_{Jul}
(190) 
_{Aug}
(339) 
_{Sep}
(142) 
_{Oct}
(72) 
_{Nov}
(300) 
_{Dec}
(142) 
2004 
_{Jan}
(285) 
_{Feb}
(548) 
_{Mar}
(442) 
_{Apr}
(424) 
_{May}
(338) 
_{Jun}
(324) 
_{Jul}
(393) 
_{Aug}
(442) 
_{Sep}
(460) 
_{Oct}
(249) 
_{Nov}
(285) 
_{Dec}
(370) 
2005 
_{Jan}
(520) 
_{Feb}
(316) 
_{Mar}
(524) 
_{Apr}
(228) 
_{May}
(217) 
_{Jun}
(355) 
_{Jul}
(300) 
_{Aug}
(331) 
_{Sep}
(264) 
_{Oct}
(252) 
_{Nov}
(264) 
_{Dec}
(297) 
2006 
_{Jan}
(430) 
_{Feb}
(288) 
_{Mar}
(436) 
_{Apr}
(248) 
_{May}
(270) 
_{Jun}
(188) 
_{Jul}
(369) 
_{Aug}
(574) 
_{Sep}
(267) 
_{Oct}
(353) 
_{Nov}
(171) 
_{Dec}
(127) 
2007 
_{Jan}
(144) 
_{Feb}
(103) 
_{Mar}
(172) 
_{Apr}
(244) 
_{May}
(299) 
_{Jun}
(145) 
_{Jul}
(237) 
_{Aug}
(269) 
_{Sep}
(232) 
_{Oct}
(341) 
_{Nov}
(314) 
_{Dec}
(264) 
2008 
_{Jan}
(767) 
_{Feb}
(369) 
_{Mar}
(678) 
_{Apr}
(403) 
_{May}
(379) 
_{Jun}
(334) 
_{Jul}
(301) 
_{Aug}
(258) 
_{Sep}
(476) 
_{Oct}
(345) 
_{Nov}
(412) 
_{Dec}
(381) 
2009 
_{Jan}
(365) 
_{Feb}
(327) 
_{Mar}
(331) 
_{Apr}
(468) 
_{May}
(389) 
_{Jun}
(376) 
_{Jul}
(441) 
_{Aug}
(719) 
_{Sep}
(456) 
_{Oct}
(410) 
_{Nov}
(621) 
_{Dec}
(509) 
2010 
_{Jan}
(552) 
_{Feb}
(306) 
_{Mar}
(336) 
_{Apr}
(389) 
_{May}
(273) 
_{Jun}
(172) 
_{Jul}
(181) 
_{Aug}
(225) 
_{Sep}
(490) 
_{Oct}
(219) 
_{Nov}
(468) 
_{Dec}
(470) 
2011 
_{Jan}
(513) 
_{Feb}
(306) 
_{Mar}
(404) 
_{Apr}
(437) 
_{May}
(357) 
_{Jun}
(364) 
_{Jul}
(350) 
_{Aug}
(440) 
_{Sep}
(466) 
_{Oct}
(352) 
_{Nov}
(284) 
_{Dec}
(339) 
2012 
_{Jan}
(558) 
_{Feb}
(406) 
_{Mar}
(477) 
_{Apr}
(488) 
_{May}
(525) 
_{Jun}
(457) 
_{Jul}
(602) 
_{Aug}
(722) 
_{Sep}
(471) 
_{Oct}
(502) 
_{Nov}
(484) 
_{Dec}
(338) 
2013 
_{Jan}
(286) 
_{Feb}
(346) 
_{Mar}
(222) 
_{Apr}
(275) 
_{May}
(277) 
_{Jun}
(172) 
_{Jul}
(325) 
_{Aug}
(373) 
_{Sep}
(295) 
_{Oct}
(531) 
_{Nov}
(437) 
_{Dec}
(455) 
2014 
_{Jan}
(496) 
_{Feb}
(383) 
_{Mar}
(198) 
_{Apr}
(213) 
_{May}
(443) 
_{Jun}
(417) 
_{Jul}
(416) 
_{Aug}
(226) 
_{Sep}
(509) 
_{Oct}
(476) 
_{Nov}
(469) 
_{Dec}
(412) 
2015 
_{Jan}
(465) 
_{Feb}
(309) 
_{Mar}
(430) 
_{Apr}
(176) 
_{May}
(224) 
_{Jun}
(291) 
_{Jul}
(224) 
_{Aug}
(412) 
_{Sep}
(1038) 
_{Oct}
(621) 
_{Nov}
(302) 
_{Dec}
(526) 
2016 
_{Jan}
(196) 
_{Feb}
(226) 
_{Mar}
(238) 
_{Apr}
(272) 
_{May}
(309) 
_{Jun}
(202) 
_{Jul}
(210) 
_{Aug}
(306) 
_{Sep}
(272) 
_{Oct}
(243) 
_{Nov}
(232) 
_{Dec}
(167) 
2017 
_{Jan}
(247) 
_{Feb}
(185) 
_{Mar}
(166) 
_{Apr}
(63) 
_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 

1
(21) 
2
(1) 
3
(27) 
4
(4) 
5
(28) 
6
(10) 
7

8
(5) 
9
(5) 
10
(11) 
11
(16) 
12
(7) 
13
(3) 
14
(1) 
15

16
(12) 
17
(9) 
18
(16) 
19
(2) 
20
(22) 
21
(39) 
22
(19) 
23
(23) 
24
(15) 
25
(1) 
26
(11) 
27
(16) 
28
(10) 
29
(2) 
30
(11) 
31
(10) 




From: Matti <math.eber@t...>  20110524 18:37:54

Hi Kevin, this sorting problem is (at least to me) still unsolved. I gave up and used a lousy workaround, reading the 2dim array into a 1dim string array like "field1/field2", then sorting this and reading the fields backward again. See Examples/Image/Lighttable, the sorting subs. Works ok with a few hundred pictures (tested up to 1200), but for your amount of data it sure will be not practicable. If somebody knows a solution, I would be glad, too. Regards Matti Am 24.05.2011 04:22, schrieb Kevin Fishburne: > > Looks like Matti had the same question back in 2009: > > http://old.nabble.com/sortmultidimensionalarraystd26051359.html#a26059190 > > The proposed solution sounds similar to the response given to me, though > my feeble brain isn't able to convert it into code. Interesting that the > post mentions a variant can be used as well as an object. > > Matti, if you're out there, do you have an example of how you sorted the > example array in your post using these (or other) techniques? > 
From: Benoît Minisini <gambas@us...>  20110524 15:55:37

> Not sure, but I think Benoit means special method "_compare" which is used > (if exist) to sort objects. > http://gambasdoc.org/help/lang/special/compare?view > http://gambasdoc.org/help/comp/gb/object%5B%5D/sort?v3 > > Jussi > Yep, sorry, I meant that.  Benoît Minisini 
From: Jussi Lahtinen <jussi.lahtinen@gm...>  20110524 15:50:57

Not sure, but I think Benoit means special method "_compare" which is used (if exist) to sort objects. http://gambasdoc.org/help/lang/special/compare?view http://gambasdoc.org/help/comp/gb/object%5B%5D/sort?v3 Jussi On Tue, May 24, 2011 at 05:22, Kevin Fishburne < kevinfishburne@...> wrote: > On 05/23/2011 10:01 PM, Kevin Fishburne wrote: > > On 05/09/2011 09:59 PM, Benoît Minisini wrote: > >>> Think of it like a spreadsheet instead of an array. I need each "row" > >>> sorted by the value in a "column". The two column values are > >>> ObjectNumber and ObjectY and the row represents the array index. > >>> > >>> There's got to be something like this in GAMBAS, but if not I can start > >>> Google searching sort algorithms and make a procedure. > >> > >>  Put the objects you have to draw on the screen in a temporary array. > >>  Define the (X,Y) final coordinates in two object variables. > >>  Implement the "_sort" special method in the object class. > >> > >> That way, you just have to call "Sort" to sort only the objects you want > the > >> way you want. > > > > The documentation didn't do much to alleviate my confusion, so if anyone > > understands this could you please post the simplest example possible? A > > link to the documentation on the _sort special method might be enough (I > > couldn't find it). As a refresher I'm basically trying to sort an array > > by one of its elements, much like sorting a spreadsheet > > Looks like Matti had the same question back in 2009: > > > http://old.nabble.com/sortmultidimensionalarraystd26051359.html#a26059190 > > The proposed solution sounds similar to the response given to me, though > my feeble brain isn't able to convert it into code. Interesting that the > post mentions a variant can be used as well as an object. > > Matti, if you're out there, do you have an example of how you sorted the > example array in your post using these (or other) techniques? > >  > Kevin Fishburne > Eight Virtues > www: http://sales.eightvirtues.com > email: sales@... > phone: (770) 8536271 > > > >  > vRanger cuts backup time in halfwhile increasing security. > With the marketleading solution for virtual backup and recovery, > you get blazingfast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/questd2dcopy1 > _______________________________________________ > Gambasuser mailing list > Gambasuser@... > https://lists.sourceforge.net/lists/listinfo/gambasuser > 
From: Doriano Blengino <doriano.blengino@fa...>  20110524 07:17:58

Kevin Fishburne ha scritto: > On 05/24/2011 12:57 AM, Bruce Bruen wrote: > >>>>> I need to know the (x, y) offset of a point at a given orientation and >>>>> velocity. For example if a point is moving at an angle of 45 degrees (or >>>>> radians, take your pick), what would its x and y coordinate be >>>>> increased/decreased by? The variables I can think of would be: >>>>> >>>>> x1 (point's current x coordinate) >>>>> y1 (point's current y coordinate) >>>>> a (point's angle/orientation in degrees/radians) >>>>> v (point's velocity) >>>>> x2 (x coordinate offset of point's new position) >>>>> y2 (y coordinate offset of point's new position) >>>>> >>>>> The calculation would take x1, y1 a and v as inputs and produce x2 and >>>>> y2 as offsets (x1 + x2, y1 + y2 = point's new position). >>>>> >>>>> Wally said: > in cartesian coordinates: > x2 = x1 + cos(a) * v * t > y2 = y1 + sin(a) * v * t which is correct; only, you specified that you want x2 and y2 "as offsets", i.e., the distance covered and not the new position. In this case, the formulas are: x2 = cos(a) * v y2 = sin(a) * v "v" indicates the velocity of the object, expressed in space/deltaT (pixels for frame, for example). The angle "a" must be in radians. Also, Bruce said: > 1) The trig is always easier if you orient your framework so the > particle is moving (from the point of view of the trig math function) in > quadrant 0 i.e. in the "north east" quarter of the compass. This done > by reflecting the angle into q0, then do the math and then dereflect it > back. On computer screens there is always this problem. Probably you can simply change the sign of y2: add x2 to x1 and subtract y2 from y1. But you could write the algorithm as is, test it, and see if you need to mirror the Y or to do a rotation (angle+90, angle+180, or whatever), or both. Bruce added: > 2) As Mr Newton said, a body will continue to move at a given rate until > acted on by an outside force. It may be useful for the future if you do > the trig calcs ONLY when the particle is so affected. If you are thinking about projectiles, they are shooted away, by a force applied to them, for a small amount of time; then the force ceases, and the projectile slows down. This can be simulated by decrementing "v" at every frame and, when "v" falls below some arbitrary value, set it to zero: the throw is terminated. May be that you don't want infinite distances, so this method gives you a way to terminate early a throw if it misses it target. Or may be that you terminate the throw when the missile hits a target, or goes out the screen. In this case, varying "v" only gives some more reality (pretty useless, may be, unless you throw boulders using catapults). I remember that your player has a heading. If the player shoots always ahead of it, then you use, in the formula of the missile, the same angle as the player orientation. If the player shoots at its right, the you must subtract 90 degrees; to the left, you add 90 degrees. Regards, Doriano 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 05:51:05

On 05/24/2011 12:57 AM, Bruce Bruen wrote: > On 24/05/11 14:08, Kevin Fishburne wrote: >> On 05/24/2011 12:16 AM, Bruce Bruen wrote: >> >>> On 24/05/11 13:14, Kevin Fishburne wrote: >>> >>>> I was already helped graciously in figuring out how to translate a point >>>> in a plane along its local axes at a given orientation, but now need a >>>> bit of the inverse of the equation. >>>> >>>> I need to know the (x, y) offset of a point at a given orientation and >>>> velocity. For example if a point is moving at an angle of 45 degrees (or >>>> radians, take your pick), what would its x and y coordinate be >>>> increased/decreased by? The variables I can think of would be: >>>> >>>> x1 (point's current x coordinate) >>>> y1 (point's current y coordinate) >>>> a (point's angle/orientation in degrees/radians) >>>> v (point's velocity) >>>> x2 (x coordinate offset of point's new position) >>>> y2 (y coordinate offset of point's new position) >>>> >>>> The calculation would take x1, y1 a and v as inputs and produce x2 and >>>> y2 as offsets (x1 + x2, y1 + y2 = point's new position). >>>> >>>> There really should be a list of basic things like this for graphics >>>> programmers. I've searched for years and found practically nothing. >>>> Weird, considering this has probably been done thousands of times since >>>> the days of DOS. :/ >>>> >>>> In case anyone's wondering why I need this, the equation will allow >>>> particles and projectiles to follow logical paths. Currently they're >>>> bound to local coordinates and ignore player orientation. Digging, >>>> shooting arrows, throwing objects, etc. can't work without it. >>>> >>>> >>>> >>> 1) Need to include i being the time increment in the same units as velocity >>> 2) Basic physics says point will move d units in i time increments according >>> to distance=velocity * time . So point will have a deltaXY of v*i. >>> Basic trig converts this to deltaX and deltaY using the old "Sign On >>> Here 'Coz Alf Has Tan OverAlls" >>> deltaX = deltaXY * sin(a) >>> deltaY=deltaXY *cos(a) >>> >>> Bobs, yer uncle, return deltaX and deltaY! >>> >> Very true. I didn't want to include time because I didn't want to >> complicate the issue. Time is basically whatever number I multiply the >> velocity by in the mystical and unknown equation. In my case time is a >> single rendering frame, so it's not currently tied to any real sense of >> the word "time". >> >> While I appreciate the hint, what's the equation for DeltaX/Y using >> Sin/Cos/Tan if that is what's being used? I think you may be a bit more >> under the weather than I. :) And it's not even Friday... Fortunately >> when I cross the threshold I stop programming and write music for the >> game. A much more forgiving medium for sure. >> >> > Not sure I understand "what's the equation for DeltaX/Y"? > Did you mean deltaXY? If so it's just v*i as stated. I think you're helping too much! I just need a basic formula for moving a point along a certain angle by a certain number of units. The angle of movement, the velocity (number of units divided by time) and the original coordinates are all known. The only unknown is how much the point's x and y coordinates should be modified by using addition/subtraction. Imagine you're looking at a piece of graph paper. You have a point drawn as a dot in pencil on an intersection of the grid. You need to move that point one unit/square in a any direction as specified in radians or degrees. It's 2D, there's no gravity, wind or curvatures of any kind. No allowance is necessary for other variables or factors. That is the equation that I need. Move the point an arbitrary number of units in an arbitrary direction. Point position, units moved and angle of movement known; new point position is unknown.  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 
From: Bruce Bruen <bbruen@pa...>  20110524 04:58:06

On 24/05/11 14:08, Kevin Fishburne wrote: > On 05/24/2011 12:16 AM, Bruce Bruen wrote: > >> On 24/05/11 13:14, Kevin Fishburne wrote: >> >>> I was already helped graciously in figuring out how to translate a point >>> in a plane along its local axes at a given orientation, but now need a >>> bit of the inverse of the equation. >>> >>> I need to know the (x, y) offset of a point at a given orientation and >>> velocity. For example if a point is moving at an angle of 45 degrees (or >>> radians, take your pick), what would its x and y coordinate be >>> increased/decreased by? The variables I can think of would be: >>> >>> x1 (point's current x coordinate) >>> y1 (point's current y coordinate) >>> a (point's angle/orientation in degrees/radians) >>> v (point's velocity) >>> x2 (x coordinate offset of point's new position) >>> y2 (y coordinate offset of point's new position) >>> >>> The calculation would take x1, y1 a and v as inputs and produce x2 and >>> y2 as offsets (x1 + x2, y1 + y2 = point's new position). >>> >>> There really should be a list of basic things like this for graphics >>> programmers. I've searched for years and found practically nothing. >>> Weird, considering this has probably been done thousands of times since >>> the days of DOS. :/ >>> >>> In case anyone's wondering why I need this, the equation will allow >>> particles and projectiles to follow logical paths. Currently they're >>> bound to local coordinates and ignore player orientation. Digging, >>> shooting arrows, throwing objects, etc. can't work without it. >>> >>> >>> >> 1) Need to include i being the time increment in the same units as velocity >> 2) Basic physics says point will move d units in i time increments according >> to distance=velocity * time . So point will have a deltaXY of v*i. >> Basic trig converts this to deltaX and deltaY using the old "Sign On >> Here 'Coz Alf Has Tan OverAlls" >> deltaX = deltaXY * sin(a) >> deltaY=deltaXY *cos(a) >> >> Bobs, yer uncle, return deltaX and deltaY! >> > Very true. I didn't want to include time because I didn't want to > complicate the issue. Time is basically whatever number I multiply the > velocity by in the mystical and unknown equation. In my case time is a > single rendering frame, so it's not currently tied to any real sense of > the word "time". > > While I appreciate the hint, what's the equation for DeltaX/Y using > Sin/Cos/Tan if that is what's being used? I think you may be a bit more > under the weather than I. :) And it's not even Friday... Fortunately > when I cross the threshold I stop programming and write music for the > game. A much more forgiving medium for sure. > > Not sure I understand "what's the equation for DeltaX/Y"? Did you mean deltaXY? If so it's just v*i as stated. By the way, a few hints if I can remember my work on sonar beamplot ray tracing from over 35 years ago: 1) The trig is always easier if you orient your framework so the particle is moving (from the point of view of the trig math function) in quadrant 0 i.e. in the "north east" quarter of the compass. This done by reflecting the angle into q0, then do the math and then dereflect it back. 2) As Mr Newton said, a body will continue to move at a given rate until acted on by an outside force. It may be useful for the future if you do the trig calcs ONLY when the particle is so affected. 3) More Newton. If you are going to include "gravity" in your system, consider it to be an outside force that always acts, i.e. every clock tick. In fact you may have to consider using sub ticks when particles are (thusly) moving along curved paths. 4) Above all make sure you use the same dimensions everywhere in your calc functions, do not have velocities that are points/second in some places and millipoints/minute somewhere else in other calcs. This will preserve you sanity next week or later when you come to modify something. 5) Finally, if you are considering 3 dimensions and therefore spherical trig  please don't call me! :) It nearly sent me mad 35 years ago, or maybe it did? 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 04:46:03

On 05/24/2011 12:34 AM, wally wrote: > On Tuesday, May 24, 2011 05:44:14 Kevin Fishburne wrote: >> I was already helped graciously in figuring out how to translate a point >> in a plane along its local axes at a given orientation, but now need a >> bit of the inverse of the equation. >> >> I need to know the (x, y) offset of a point at a given orientation and >> velocity. For example if a point is moving at an angle of 45 degrees (or >> radians, take your pick), what would its x and y coordinate be >> increased/decreased by? The variables I can think of would be: >> >> x1 (point's current x coordinate) >> y1 (point's current y coordinate) >> a (point's angle/orientation in degrees/radians) >> v (point's velocity) >> x2 (x coordinate offset of point's new position) >> y2 (y coordinate offset of point's new position) >> >> The calculation would take x1, y1 a and v as inputs and produce x2 and >> y2 as offsets (x1 + x2, y1 + y2 = point's new position). >> >> There really should be a list of basic things like this for graphics >> programmers. I've searched for years and found practically nothing. >> Weird, considering this has probably been done thousands of times since >> the days of DOS. :/ >> >> In case anyone's wondering why I need this, the equation will allow >> particles and projectiles to follow logical paths. Currently they're >> bound to local coordinates and ignore player orientation. Digging, >> shooting arrows, throwing objects, etc. can't work without it. > > Hello Kevin, > > the problem seems pretty easy to solve, so I'm not sue i understand > the question correctly. > A good idea would be to use polar coordinates for this: > > P( r, a) where r = radial distance to (0,0) offset and a the angle a . > r = sqrt( x^2 + y^2) > > r(p2) = r(p1) + vt , > new radius point 2 = 1st radius + distance to move (velocity * time) > a does not change > > in cartesian coordinates: > x2 = x1 + cos(a) * v * t > y2 = y1 + sin(a) * v * t > > if you need more complex paths, using matrices is a good way. > > but always time is needed to calculate. You did not mention time t > so i assume i did not understand the question. Hi Wally. I'm going to test that code, but my gut tells me that it's correct. The two Cartesian coordinate lines are surely correct (I will confirm in the next couple of days). The reason it seems easy and that you think you may have misunderstood my question is probably because I'm really bad at math other than basic algebra. It's a hell of a thing, as I'm dangerously clever in many other ways. Thank you, and as I said I'll let everyone know if that does the trick. I'll even put up a YouTube video of the righteous usage of the algorithm to show how cool its implementation is. :)  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 04:38:51

On 05/24/2011 12:16 AM, Bruce Bruen wrote: > On 24/05/11 13:14, Kevin Fishburne wrote: >> I was already helped graciously in figuring out how to translate a point >> in a plane along its local axes at a given orientation, but now need a >> bit of the inverse of the equation. >> >> I need to know the (x, y) offset of a point at a given orientation and >> velocity. For example if a point is moving at an angle of 45 degrees (or >> radians, take your pick), what would its x and y coordinate be >> increased/decreased by? The variables I can think of would be: >> >> x1 (point's current x coordinate) >> y1 (point's current y coordinate) >> a (point's angle/orientation in degrees/radians) >> v (point's velocity) >> x2 (x coordinate offset of point's new position) >> y2 (y coordinate offset of point's new position) >> >> The calculation would take x1, y1 a and v as inputs and produce x2 and >> y2 as offsets (x1 + x2, y1 + y2 = point's new position). >> >> There really should be a list of basic things like this for graphics >> programmers. I've searched for years and found practically nothing. >> Weird, considering this has probably been done thousands of times since >> the days of DOS. :/ >> >> In case anyone's wondering why I need this, the equation will allow >> particles and projectiles to follow logical paths. Currently they're >> bound to local coordinates and ignore player orientation. Digging, >> shooting arrows, throwing objects, etc. can't work without it. >> >> > 1) Need to include i being the time increment in the same units as velocity > 2) Basic physics says point will move d units in i time increments according > to distance=velocity * time . So point will have a deltaXY of v*i. > Basic trig converts this to deltaX and deltaY using the old "Sign On > Here 'Coz Alf Has Tan OverAlls" > deltaX = deltaXY * sin(a) > deltaY=deltaXY *cos(a) > > Bobs, yer uncle, return deltaX and deltaY! Very true. I didn't want to include time because I didn't want to complicate the issue. Time is basically whatever number I multiply the velocity by in the mystical and unknown equation. In my case time is a single rendering frame, so it's not currently tied to any real sense of the word "time". While I appreciate the hint, what's the equation for DeltaX/Y using Sin/Cos/Tan if that is what's being used? I think you may be a bit more under the weather than I. :) And it's not even Friday... Fortunately when I cross the threshold I stop programming and write music for the game. A much more forgiving medium for sure.  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 
From: wally <wally@vo...>  20110524 04:34:38

On Tuesday, May 24, 2011 05:44:14 Kevin Fishburne wrote: > I was already helped graciously in figuring out how to translate a point > in a plane along its local axes at a given orientation, but now need a > bit of the inverse of the equation. > > I need to know the (x, y) offset of a point at a given orientation and > velocity. For example if a point is moving at an angle of 45 degrees (or > radians, take your pick), what would its x and y coordinate be > increased/decreased by? The variables I can think of would be: > > x1 (point's current x coordinate) > y1 (point's current y coordinate) > a (point's angle/orientation in degrees/radians) > v (point's velocity) > x2 (x coordinate offset of point's new position) > y2 (y coordinate offset of point's new position) > > The calculation would take x1, y1 a and v as inputs and produce x2 and > y2 as offsets (x1 + x2, y1 + y2 = point's new position). > > There really should be a list of basic things like this for graphics > programmers. I've searched for years and found practically nothing. > Weird, considering this has probably been done thousands of times since > the days of DOS. :/ > > In case anyone's wondering why I need this, the equation will allow > particles and projectiles to follow logical paths. Currently they're > bound to local coordinates and ignore player orientation. Digging, > shooting arrows, throwing objects, etc. can't work without it. Hello Kevin, the problem seems pretty easy to solve, so I'm not sue i understand the question correctly. A good idea would be to use polar coordinates for this: P( r, a) where r = radial distance to (0,0) offset and a the angle a . r = sqrt( x^2 + y^2) r(p2) = r(p1) + vt , new radius point 2 = 1st radius + distance to move (velocity * time) a does not change in cartesian coordinates: x2 = x1 + cos(a) * v * t y2 = y1 + sin(a) * v * t if you need more complex paths, using matrices is a good way. but always time is needed to calculate. You did not mention time t so i assume i did not understand the question. wally 
From: Bruce Bruen <bbruen@pa...>  20110524 04:16:33

On 24/05/11 13:14, Kevin Fishburne wrote: > I was already helped graciously in figuring out how to translate a point > in a plane along its local axes at a given orientation, but now need a > bit of the inverse of the equation. > > I need to know the (x, y) offset of a point at a given orientation and > velocity. For example if a point is moving at an angle of 45 degrees (or > radians, take your pick), what would its x and y coordinate be > increased/decreased by? The variables I can think of would be: > > x1 (point's current x coordinate) > y1 (point's current y coordinate) > a (point's angle/orientation in degrees/radians) > v (point's velocity) > x2 (x coordinate offset of point's new position) > y2 (y coordinate offset of point's new position) > > The calculation would take x1, y1 a and v as inputs and produce x2 and > y2 as offsets (x1 + x2, y1 + y2 = point's new position). > > There really should be a list of basic things like this for graphics > programmers. I've searched for years and found practically nothing. > Weird, considering this has probably been done thousands of times since > the days of DOS. :/ > > In case anyone's wondering why I need this, the equation will allow > particles and projectiles to follow logical paths. Currently they're > bound to local coordinates and ignore player orientation. Digging, > shooting arrows, throwing objects, etc. can't work without it. > > 1) Need to include i being the time increment in the same units as velocity 2) Basic physics says point will move d units in i time increments according to distance=velocity * time . So point will have a deltaXY of v*i. Basic trig converts this to deltaX and deltaY using the old "Sign On Here 'Coz Alf Has Tan OverAlls" deltaX = deltaXY * sin(a) deltaY=deltaXY *cos(a) Bobs, yer uncle, return deltaX and deltaY! 
From: Bruce Bruen <bbruen@pa...>  20110524 04:02:12

On 24/05/11 11:52, Kevin Fishburne wrote: > On 05/23/2011 10:01 PM, Kevin Fishburne wrote: > >> On 05/09/2011 09:59 PM, Benoît Minisini wrote: >> >>>> Think of it like a spreadsheet instead of an array. I need each "row" >>>> sorted by the value in a "column". The two column values are >>>> ObjectNumber and ObjectY and the row represents the array index. >>>> >>>> There's got to be something like this in GAMBAS, but if not I can start >>>> Google searching sort algorithms and make a procedure. >>>> >>>  Put the objects you have to draw on the screen in a temporary array. >>>  Define the (X,Y) final coordinates in two object variables. >>>  Implement the "_sort" special method in the object class. >>> >>> That way, you just have to call "Sort" to sort only the objects you want the >>> way you want. >>> >> The documentation didn't do much to alleviate my confusion, so if anyone >> understands this could you please post the simplest example possible? A >> link to the documentation on the _sort special method might be enough (I >> couldn't find it). As a refresher I'm basically trying to sort an array >> by one of its elements, much like sorting a spreadsheet >> > Looks like Matti had the same question back in 2009: > > http://old.nabble.com/sortmultidimensionalarraystd26051359.html#a26059190 > > The proposed solution sounds similar to the response given to me, though > my feeble brain isn't able to convert it into code. Interesting that the > post mentions a variant can be used as well as an object. > > Matti, if you're out there, do you have an example of how you sorted the > example array in your post using these (or other) techniques? > > Kevin, Here is the code I use to sort a tableview. It is constrained by a) only coping with string or numeric data b) only sorts ascending. but it may get you started PUBLIC SUB SELF_ColumnClick(Col AS Integer) '========================================== ' Sort the underlying gridview by the selected column. NB this will only ' sort the display data  any onscreen formatting that relies ' on the underlying data will refer to the "wrong row"! ' These are the two native arrays that we will sort using their own sort method DIM sarray AS NEW String[ME.Rows.Count] DIM narray AS NEW Float[ME.Rows.Count] ' We need a few indices to operate on the orginal array and the sort array DIM idx, idy AS Integer DIM ida, idv AS Integer ' This is a flag to tell us which sort array to use DIM numeric AS Boolean = TRUE ' First figure out if the column only contains numbers. If not then we will ' just use a string sort FOR idx = 0 TO ME.Rows.Count  1 IF NOT IsNumber(Val(ME[idx, Col].Text)) THEN numeric = FALSE NEXT ' Now unload each item from the original array into the relevant sort array FOR idx = 0 TO ME.Rows.Count  1 IF numeric narray[idx] = Val(ME[idx, Col].Text) ELSE sarray[idx] = ME[idx, Col].Text ENDIF NEXT ' and sort it! IF numeric narray.Sort(gb.Ascent) ELSE sarray.Sort(gb.Ascent + gb.Text) ENDIF ' Now the tricky bit, use the sorted sort array to reorder the original array FOR ida = 0 TO sarray.Max ' upper limit is the size of any of the arrays ' idv is the row offset for the original array ' in each loop, we only have to look "downwards" from where we are in the ' sort array ( i.e. from ida onwards) and no need to do the last row! FOR idv = ida TO ME.Rows.Count  1 IF IIf(numeric, narray[ida], sarray[ida]) = ME[idv, col].Text ' have we found the row? IF ida <> idv ' is it in the wrong place? FOR idx = 0 TO ME.Columns.Count  1 ' then swap it SWAP ME[idv, idx].Text, ME[ida, idx].Text NEXT ENDIF BREAK ' and stop looking for it ENDIF NEXT ' inc idv  haven't found it so keep looking NEXT ' inc ida  loop back for the next sorted row END 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 03:44:33

I was already helped graciously in figuring out how to translate a point in a plane along its local axes at a given orientation, but now need a bit of the inverse of the equation. I need to know the (x, y) offset of a point at a given orientation and velocity. For example if a point is moving at an angle of 45 degrees (or radians, take your pick), what would its x and y coordinate be increased/decreased by? The variables I can think of would be: x1 (point's current x coordinate) y1 (point's current y coordinate) a (point's angle/orientation in degrees/radians) v (point's velocity) x2 (x coordinate offset of point's new position) y2 (y coordinate offset of point's new position) The calculation would take x1, y1 a and v as inputs and produce x2 and y2 as offsets (x1 + x2, y1 + y2 = point's new position). There really should be a list of basic things like this for graphics programmers. I've searched for years and found practically nothing. Weird, considering this has probably been done thousands of times since the days of DOS. :/ In case anyone's wondering why I need this, the equation will allow particles and projectiles to follow logical paths. Currently they're bound to local coordinates and ignore player orientation. Digging, shooting arrows, throwing objects, etc. can't work without it.  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 02:23:04

On 05/23/2011 10:01 PM, Kevin Fishburne wrote: > On 05/09/2011 09:59 PM, Benoît Minisini wrote: >>> Think of it like a spreadsheet instead of an array. I need each "row" >>> sorted by the value in a "column". The two column values are >>> ObjectNumber and ObjectY and the row represents the array index. >>> >>> There's got to be something like this in GAMBAS, but if not I can start >>> Google searching sort algorithms and make a procedure. >> >>  Put the objects you have to draw on the screen in a temporary array. >>  Define the (X,Y) final coordinates in two object variables. >>  Implement the "_sort" special method in the object class. >> >> That way, you just have to call "Sort" to sort only the objects you want the >> way you want. > > The documentation didn't do much to alleviate my confusion, so if anyone > understands this could you please post the simplest example possible? A > link to the documentation on the _sort special method might be enough (I > couldn't find it). As a refresher I'm basically trying to sort an array > by one of its elements, much like sorting a spreadsheet Looks like Matti had the same question back in 2009: http://old.nabble.com/sortmultidimensionalarraystd26051359.html#a26059190 The proposed solution sounds similar to the response given to me, though my feeble brain isn't able to convert it into code. Interesting that the post mentions a variant can be used as well as an object. Matti, if you're out there, do you have an example of how you sorted the example array in your post using these (or other) techniques?  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 
From: Bruce Bruen <bbruen@pa...>  20110524 02:19:13

On 23/05/11 22:49, Benoît Minisini wrote: >> On 23/05/11 21:54, Bruce Bruen wrote: >> >>> I have a TabStrip with a TableView in each tab. The Click event is set >>> up to allow the user to edit the cell inplace, which works fine as long >>> as they stay on the same tab. >>> But if they change the active tab while the editor is active, it stays >>> active??? and the textbox is visible on the other tab (and can be >>> clicked on to "continue" the edit. Once this is done, then clicking on >>> any other cell in the new tab still leaves the editor active. >>> >>> There appears to me to be no way to cancel the editor. Is this true? >>> bruce >>> >> n.b. Does not seem to happen under KDE only GTK! >> >> > Can you send me a little project example that shows exactly the problem? > > Thanks. > > Attached bruce 
From: Kevin Fishburne <kevinfishburne@ei...>  20110524 02:01:37

On 05/09/2011 09:59 PM, Benoît Minisini wrote: >> Think of it like a spreadsheet instead of an array. I need each "row" >> sorted by the value in a "column". The two column values are >> ObjectNumber and ObjectY and the row represents the array index. >> >> There's got to be something like this in GAMBAS, but if not I can start >> Google searching sort algorithms and make a procedure. > >  Put the objects you have to draw on the screen in a temporary array. >  Define the (X,Y) final coordinates in two object variables. >  Implement the "_sort" special method in the object class. > > That way, you just have to call "Sort" to sort only the objects you want the > way you want. The documentation didn't do much to alleviate my confusion, so if anyone understands this could you please post the simplest example possible? A link to the documentation on the _sort special method might be enough (I couldn't find it). As a refresher I'm basically trying to sort an array by one of its elements, much like sorting a spreadsheet.  Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com email: sales@... phone: (770) 8536271 