gdalgorithms-list Mailing List for Game Dev Algorithms (Page 1436)
Brought to you by:
vexxed72
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(390) |
Aug
(767) |
Sep
(940) |
Oct
(964) |
Nov
(819) |
Dec
(762) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(680) |
Feb
(1075) |
Mar
(954) |
Apr
(595) |
May
(725) |
Jun
(868) |
Jul
(678) |
Aug
(785) |
Sep
(410) |
Oct
(395) |
Nov
(374) |
Dec
(419) |
2002 |
Jan
(699) |
Feb
(501) |
Mar
(311) |
Apr
(334) |
May
(501) |
Jun
(507) |
Jul
(441) |
Aug
(395) |
Sep
(540) |
Oct
(416) |
Nov
(369) |
Dec
(373) |
2003 |
Jan
(514) |
Feb
(488) |
Mar
(396) |
Apr
(624) |
May
(590) |
Jun
(562) |
Jul
(546) |
Aug
(463) |
Sep
(389) |
Oct
(399) |
Nov
(333) |
Dec
(449) |
2004 |
Jan
(317) |
Feb
(395) |
Mar
(136) |
Apr
(338) |
May
(488) |
Jun
(306) |
Jul
(266) |
Aug
(424) |
Sep
(502) |
Oct
(170) |
Nov
(170) |
Dec
(134) |
2005 |
Jan
(249) |
Feb
(109) |
Mar
(119) |
Apr
(282) |
May
(82) |
Jun
(113) |
Jul
(56) |
Aug
(160) |
Sep
(89) |
Oct
(98) |
Nov
(237) |
Dec
(297) |
2006 |
Jan
(151) |
Feb
(250) |
Mar
(222) |
Apr
(147) |
May
(266) |
Jun
(313) |
Jul
(367) |
Aug
(135) |
Sep
(108) |
Oct
(110) |
Nov
(220) |
Dec
(47) |
2007 |
Jan
(133) |
Feb
(144) |
Mar
(247) |
Apr
(191) |
May
(191) |
Jun
(171) |
Jul
(160) |
Aug
(51) |
Sep
(125) |
Oct
(115) |
Nov
(78) |
Dec
(67) |
2008 |
Jan
(165) |
Feb
(37) |
Mar
(130) |
Apr
(111) |
May
(91) |
Jun
(142) |
Jul
(54) |
Aug
(104) |
Sep
(89) |
Oct
(87) |
Nov
(44) |
Dec
(54) |
2009 |
Jan
(283) |
Feb
(113) |
Mar
(154) |
Apr
(395) |
May
(62) |
Jun
(48) |
Jul
(52) |
Aug
(54) |
Sep
(131) |
Oct
(29) |
Nov
(32) |
Dec
(37) |
2010 |
Jan
(34) |
Feb
(36) |
Mar
(40) |
Apr
(23) |
May
(38) |
Jun
(34) |
Jul
(36) |
Aug
(27) |
Sep
(9) |
Oct
(18) |
Nov
(25) |
Dec
|
2011 |
Jan
(1) |
Feb
(14) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(37) |
Sep
(6) |
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(7) |
Mar
|
Apr
(4) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(10) |
2013 |
Jan
|
Feb
(1) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(14) |
Feb
|
Mar
(2) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: Matt A. <de...@gm...> - 2000-07-18 16:18:22
|
Yes, this is what I actually did. But I'm really thinking about the things Adam was saying maybe I should have a deeper look at me overall object structure. Currently I'm seeking some better OO-guidelines for a redesign - I want to avoid regularly ending up with problems due to a weak class design But of course Stephen Baker is right, and this list is not the right place to discuss it in all details ( Sorry, I didn't realize this'll be such a long thread ) Btw. thanks for the info about sweng-gamedev list, Scott Maybe that'll prevent some OT questions like mine in future;) Matt ----- Original Message ----- From: Mark Atkinson <ma...@ci...> To: <gda...@li...> Cc: <ma...@ci...> Sent: Tuesday, July 18, 2000 1:48 PM Subject: Re: [Algorithms] C++ inherited constructors > You can always make the ctor throw an exception, which is an acceptable form > of error handling in this case. > > Matt, I think the solution to the problem is to add another constructor to > your main-threadloop-class and your CThread which take an existing thread > handle, e.g.: > > class MainThreadLoop > { > MainThreadLoop(HANDLE hThread) : CThread(hThread) /*, m_x(0)*/{/*etc*/} > }; > > class CThread > { > CThread() { /* create a thread */ } > CThread(HANDLE hThread) { /* use given thread */ } > > /* or: CThread(HANDLE hThread=0) > { > if (hThread==0) { hThread = CreateThread(...); } > } */ > }; > > WinMain(...) > { > MainThreadLoop MainLoop(GetCurrentThread()); > } > > > -=Mark=- > > Mark Atkinson, Technical Director, Computer Artworks Ltd. > http://www.artworks.co.uk > > > > That, together with the fact that constructors can't return error codes > > (only throw exceptions) when something goes wrong, has me following a very > > simple design heuristic ever since I can remember: Don't make a > > constructor > > do anything other than initializing member variables. In other words, > > don't > > let it do anything that can go wrong. Put that code (for example the > > thread > > creation code in your case) in another method that has to be called after > > construction. If you had done that when you designed the CThread class, > > you > > wouldn't have a problem. > > -- > > --Adam Moravanszky > > http://www.n.ethz.ch/student/adammo > > > > -----Original Message----- > > From: Matt Adams <de...@gm...> > > To: gda...@li... > > <gda...@li...> > > Date: Saturday, July 15, 2000 1:19 PM > > Subject: Re: [Algorithms] C++ inherited constructors > > > > > > >I need this for aesthetic reasons :) > > >I've got an abstract CThread class. If a want to create a new thread, I > > >build my process class and inherit CThread, which creates a new thread by > > >construction. > > >Now I want my main-threadloop-class to inherit CThread, too, to provide > > all > > >the thread functionality to my main thread. But that thread already > > exists > > > created by compiler ), and shouldn't be created again by CThread. > > >Of course I can put CThread () and ~CThread () in functions like Create() > > >and Destroy() and leave the constructor / destructor empty. But it'd be > > >nicer if it could be done in another way... > > > > > >----- Original Message ----- > > >From: Favnir > > >To: gda...@li... > > >Sent: Saturday, July 15, 2000 1:32 PM > > >Subject: Re: [Algorithms] C++ inherited constructors > > > > > >The only way you can do this is to define a (preferably) protected > > >do-nothing constructor for the base class, and inherit it in the subclass > > >constructor. > > > > > >But, why in the world would you need to do this, in the first place? > > > > > >Are, > > >F > > > > > >----- Original Message ----- > > >From: Matt Adams > > >To: gda...@li... > > >Sent: Saturday, July 15, 2000 12:22 PM > > >Subject: [Algorithms] C++ inherited constructors > > > > > > > > >Hi, > > > > > >I got a question about the C++ class hierarchy. > > > > > >class a > > >{ > > > a () {...}; // constr a > > >}; > > > > > >class b : a > > >{ > > > b () {...}; // constr b > > >}; > > > > > >b instance; > > > > > >When creating an instance of b, constructors for both class a and class b > > >are called. > > >Is there a way to suppress the automatic calling of constructor a ? > > >Or something like 'overloading' the old constructor by a new one ? > > >I couldn't find anything like that in the compiler docs. > > > > > >Any help appreciated, > > >Matt > > > > > > > > >_______________________________________________ > > >GDAlgorithms-list mailing list > > >GDA...@li... > > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > > > > >_______________________________________________ > > >GDAlgorithms-list mailing list > > >GDA...@li... > > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Peter D. <pd...@mm...> - 2000-07-18 15:52:28
|
> Hmm... I'm not sure what's wrong with it, it's some C order of operations > problem > that I'm not familiar with. The code assigns to x several times without an intervening sequence point and invokes undefined behavior. The compiler is free to do the assignments to x in any order. -- Peter Dimov Multi Media Ltd. |
From: Michael S. H. <mic...@ud...> - 2000-07-18 12:34:14
|
hehe. True. That comment reflects the fact that all of our basic data files are in Motorola format and have to be converted when running on the PC At 10:48 AM 7/18/00, you wrote: > >----- Original Message ----- >From: <mailto:mic...@ud...>Michael S. Harrison >To: <mailto:gda...@li...>gda...@li... >Sent: Tuesday, July 18, 2000 1:17 AM >Subject: Re: [Algorithms] Byte Swapping > >[ SNIP ] >/* these assume that the swapping is from motorola to intel format */ > >[ SNIP ] > > >...or vice versa ;-)))) > >Are, >F > |
From: <ma...@ci...> - 2000-07-18 11:48:44
|
You can always make the ctor throw an exception, which is an acceptable form of error handling in this case. Matt, I think the solution to the problem is to add another constructor to your main-threadloop-class and your CThread which take an existing thread handle, e.g.: class MainThreadLoop { MainThreadLoop(HANDLE hThread) : CThread(hThread) /*, m_x(0)*/{/*etc*/} }; class CThread { CThread() { /* create a thread */ } CThread(HANDLE hThread) { /* use given thread */ } /* or: CThread(HANDLE hThread=0) { if (hThread==0) { hThread = CreateThread(...); } } */ }; WinMain(...) { MainThreadLoop MainLoop(GetCurrentThread()); } -=Mark=- Mark Atkinson, Technical Director, Computer Artworks Ltd. http://www.artworks.co.uk > That, together with the fact that constructors can't return error codes > (only throw exceptions) when something goes wrong, has me following a very > simple design heuristic ever since I can remember: Don't make a > constructor > do anything other than initializing member variables. In other words, > don't > let it do anything that can go wrong. Put that code (for example the > thread > creation code in your case) in another method that has to be called after > construction. If you had done that when you designed the CThread class, > you > wouldn't have a problem. > -- > --Adam Moravanszky > http://www.n.ethz.ch/student/adammo > > -----Original Message----- > From: Matt Adams <de...@gm...> > To: gda...@li... > <gda...@li...> > Date: Saturday, July 15, 2000 1:19 PM > Subject: Re: [Algorithms] C++ inherited constructors > > > >I need this for aesthetic reasons :) > >I've got an abstract CThread class. If a want to create a new thread, I > >build my process class and inherit CThread, which creates a new thread by > >construction. > >Now I want my main-threadloop-class to inherit CThread, too, to provide > all > >the thread functionality to my main thread. But that thread already > exists > > created by compiler ), and shouldn't be created again by CThread. > >Of course I can put CThread () and ~CThread () in functions like Create() > >and Destroy() and leave the constructor / destructor empty. But it'd be > >nicer if it could be done in another way... > > > >----- Original Message ----- > >From: Favnir > >To: gda...@li... > >Sent: Saturday, July 15, 2000 1:32 PM > >Subject: Re: [Algorithms] C++ inherited constructors > > > >The only way you can do this is to define a (preferably) protected > >do-nothing constructor for the base class, and inherit it in the subclass > >constructor. > > > >But, why in the world would you need to do this, in the first place? > > > >Are, > >F > > > >----- Original Message ----- > >From: Matt Adams > >To: gda...@li... > >Sent: Saturday, July 15, 2000 12:22 PM > >Subject: [Algorithms] C++ inherited constructors > > > > > >Hi, > > > >I got a question about the C++ class hierarchy. > > > >class a > >{ > > a () {...}; // constr a > >}; > > > >class b : a > >{ > > b () {...}; // constr b > >}; > > > >b instance; > > > >When creating an instance of b, constructors for both class a and class b > >are called. > >Is there a way to suppress the automatic calling of constructor a ? > >Or something like 'overloading' the old constructor by a new one ? > >I couldn't find anything like that in the compiler docs. > > > >Any help appreciated, > >Matt > > > > > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDA...@li... > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDA...@li... > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > |
From: mandor <ma...@sd...> - 2000-07-18 11:11:16
|
Hi I'v implemented the polygon reduction algo described by S. Melax in gdmag (ok, it was easy: he gives the source code :) ). But now, I have to texture the reduced object, and I was wondering what was the common approach in this case...? Thx Mandor |
From: Daniel K. <Dan...@ix...> - 2000-07-18 09:42:06
|
Hi Listizens, well, if you look at the line y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); especially at the first xor op (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) then you see that the result of the first assignment (x = x>>16 | x<<16), let's call it 'z' is used in the calculation of the second term (x = (x^x>>8) & 0x00FF00FF) or (x = (z^z>>8) & 0x00ff00ff) The new result will overwrite the old content of x (which was z), i.e. the whole operation y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8) doesnt equal y = z ^ x ^ (x<<8) as expected but y = x ^ x ^ (x<<8) which basically is y = 0 ^(x<<8) = (x<<8) ! That gets us x = 0x01020304 new x #1 (=z) = 0x03040102 new x #2 = (0x03040102 ^ 0x00030401) & 0x00ff00ff = 0x00070003 y = 0 ^ (0x00070003<<8) = 0x07000300. When you write it as y = x = (x>>16)|(x<<16); y ^= (x = ((x^(x>>8)) & 0x00FF00FF)); y ^= (x<<8); the 'z' from above is stored in 'y' as well. That's why the threeliner gives the correct result... Cheers, Daniel. > -----Original Message----- > From: Charles Bloom [mailto:cb...@cb...] > Sent: Tuesday, July 18, 2000 4:50 AM > To: gda...@li... > Subject: Re: [Algorithms] Byte Swapping > > > > Hmm... I'm not sure what's wrong with it, it's some C order > of operations > problem > that I'm not familiar with. If you expand it out into simple steps : > > y = x = (x>>16)|(x<<16); > y ^= (x = ((x^(x>>8)) & 0x00FF00FF)); > y ^= (x<<8); > > then it works just fine. If you have four bytes ABCD, the first line > turns them into CDAB. The second line gives you (0D0B^0C0A). The > last line is thus (D0B0^C0A0). Put them all together : > > y = CDAB^0D0B^0C0A^D0B0^C0A0 = DCBA > > Anyway, this is all just a curiosity because I don't think that's the > most efficient way to do it :^) > > At 12:36 PM 7/18/2000 +1000, you wrote: > >It looks like the way this is meant to work is that it swaps > the top and > >bottom 16 bits then proceeds to do the old 3 xor byte swapping trick > >(x^=y^=x) for each of the two 16 bit segments but I think > the code is a > >little bit broken. I can't see how that second bit works. > > > > > >-----Original Message----- > >From: brian sharon <br...@hu...> > >To: gda...@li... > ><gda...@li...> > >Date: Tuesday, 18 July 2000 12:02 > >Subject: Re: [Algorithms] Byte Swapping > > > > > >> > >>> From: Charles Bloom <cb...@cb...> > >>> > >>> Jumping in late : I'm sure you don't need it now, but > >>> here's a crazy ANSI C byte-swapper : > >>> > >>> let x = a 32 bit ulong , ABCD > >>> then y = DCBA > >>> > >>> y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); > >>> > >> > >>wow, I'll say that's crazy...but unfortunately > non-functional. see the > >>results of this program: > >> > >>#include <stdio.h> > >> > >>long swap1(long x) > >>{ > >> return (x = x>>16 | x<<16) ^ (x = (x^x>>8) & > 0x00FF00FF) ^ (x<<8); > >>} > >> > >>long swap2(long x) > >>{ > >> return ((x >> 24) & 0x000000FF) > >> | ((x >> 8 ) & 0x0000FF00) > >> | ((x << 8 ) & 0x00FF0000) > >> | ((x << 24) & 0xFF000000) > >> ; > >>} > >> > >>int main(int argc, char **argv) > >>{ > >> long test = 0x01020304; > >> > >> printf("swap1: 0x%08X 0x%08X 0x%08X \n", test, swap1(test), > >>swap1(swap1(test))); > >> > >> printf("swap2: 0x%08X 0x%08X 0x%08X \n", test, swap2(test), > >>swap2(swap2(test))); > >>} > >> > >>swap1: 0x01020304 0x07000300 0x03000700 > >>swap2: 0x01020304 0x04030201 0x01020304 > >> > >> > >> > > > [snip] > |
From: Favnir <fa...@wi...> - 2000-07-18 07:48:57
|
----- Original Message -----=20 From: Michael S. Harrison=20 To: gda...@li...=20 Sent: Tuesday, July 18, 2000 1:17 AM Subject: Re: [Algorithms] Byte Swapping [ SNIP ] /* these assume that the swapping is from motorola to intel format */ [ SNIP ] ...or vice versa ;-)))) Are, F |
From: Charles B. <cb...@cb...> - 2000-07-18 02:50:48
|
Hmm... I'm not sure what's wrong with it, it's some C order of operations problem that I'm not familiar with. If you expand it out into simple steps : y = x = (x>>16)|(x<<16); y ^= (x = ((x^(x>>8)) & 0x00FF00FF)); y ^= (x<<8); then it works just fine. If you have four bytes ABCD, the first line turns them into CDAB. The second line gives you (0D0B^0C0A). The last line is thus (D0B0^C0A0). Put them all together : y = CDAB^0D0B^0C0A^D0B0^C0A0 = DCBA Anyway, this is all just a curiosity because I don't think that's the most efficient way to do it :^) At 12:36 PM 7/18/2000 +1000, you wrote: >It looks like the way this is meant to work is that it swaps the top and >bottom 16 bits then proceeds to do the old 3 xor byte swapping trick >(x^=y^=x) for each of the two 16 bit segments but I think the code is a >little bit broken. I can't see how that second bit works. > > >-----Original Message----- >From: brian sharon <br...@hu...> >To: gda...@li... ><gda...@li...> >Date: Tuesday, 18 July 2000 12:02 >Subject: Re: [Algorithms] Byte Swapping > > >> >>> From: Charles Bloom <cb...@cb...> >>> >>> Jumping in late : I'm sure you don't need it now, but >>> here's a crazy ANSI C byte-swapper : >>> >>> let x = a 32 bit ulong , ABCD >>> then y = DCBA >>> >>> y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); >>> >> >>wow, I'll say that's crazy...but unfortunately non-functional. see the >>results of this program: >> >>#include <stdio.h> >> >>long swap1(long x) >>{ >> return (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); >>} >> >>long swap2(long x) >>{ >> return ((x >> 24) & 0x000000FF) >> | ((x >> 8 ) & 0x0000FF00) >> | ((x << 8 ) & 0x00FF0000) >> | ((x << 24) & 0xFF000000) >> ; >>} >> >>int main(int argc, char **argv) >>{ >> long test = 0x01020304; >> >> printf("swap1: 0x%08X 0x%08X 0x%08X \n", test, swap1(test), >>swap1(swap1(test))); >> >> printf("swap2: 0x%08X 0x%08X 0x%08X \n", test, swap2(test), >>swap2(swap2(test))); >>} >> >>swap1: 0x01020304 0x07000300 0x03000700 >>swap2: 0x01020304 0x04030201 0x01020304 >> >> >> >>anyway, in case anyone hasn't gotten their fill of this stuff, here is our >>comparatively lame byteswapping code that uses those fast swappers on >>PowerPC: >> >>#ifndef _MBSWAP_H_ >>#define _MBSWAP_H_ >> >>// swapping macros/inlines >>#include <Runtime/MBBase.h> >> >>inline MBint16 MBSwap(const MBint16 & swap) >>{ >>#if defined(MB_MAC) && defined(MB_POWERPC) >> return __lhbrx(const_cast<MBint16 *>(&swap), 0); >>#else >> return ((swap >> 8 ) & 0x00FF) >> | ((swap << 8 ) & 0xFF00) >> ; >>#endif >>} >> >>inline MBuint16 MBSwap(const MBuint16 & swap) >>{ >>#if defined(MB_MAC) && defined(MB_POWERPC) >> return __lhbrx(const_cast<MBuint16 *>(&swap), 0); >>#else >> return ((swap >> 8 ) & 0x00FF) >> | ((swap << 8 ) & 0xFF00) >> ; >>#endif >>} >> >>inline MBint32 MBSwap(const MBint32 & swap) >>{ >>#if defined(MB_MAC) && defined(MB_POWERPC) >> return __lwbrx(const_cast<MBint32 *>(&swap), 0); >>#else >> return ((swap >> 24) & 0x000000FF) >> | ((swap >> 8 ) & 0x0000FF00) >> | ((swap << 8 ) & 0x00FF0000) >> | ((swap << 24) & 0xFF000000) >> ; >>#endif >>} >> >>inline MBuint32 MBSwap(const MBuint32 & swap) >>{ >>#if defined(MB_MAC) && defined(MB_POWERPC) >> return __lwbrx(const_cast<MBuint32 *>(&swap), 0); >>#else >> return ((swap >> 24) & 0x000000FF) >> | ((swap >> 8 ) & 0x0000FF00) >> | ((swap << 8 ) & 0x00FF0000) >> | ((swap << 24) & 0xFF000000) >> ; >>#endif >>} >> >>inline MBfloat MBSwap(const MBfloat & swap) >>{ >> MBuint32 temp = *(const MBuint32*)&swap; >> temp = MBSwap(temp); >> return *(const MBfloat *)&temp; >>} >> >>#ifdef MB_MSB >> >> #define MBSwapMSBToNative( s ) s >> #define MBSwapNativeToMSB( s ) s >> >> #define MBSwapLSBToNative MBSwap >> #define MBSwapNativeToLSB MBSwap >> >>#elif defined(MB_LSB) >> >> #define MBSwapLSBToNative( s ) s >> #define MBSwapNativeToLSB( s ) s >> >> #define MBSwapMSBToNative MBSwap >> #define MBSwapNativeToMSB MBSwap >> >>#endif >> >>#endif // header guard >> >> >> >>_______________________________________________ >>GDAlgorithms-list mailing list >>GDA...@li... >>http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list >> > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > -------------------------------------- Charles Bloom www.cbloom.com |
From: Aaron D. <ri...@ho...> - 2000-07-18 02:29:04
|
It looks like the way this is meant to work is that it swaps the top and bottom 16 bits then proceeds to do the old 3 xor byte swapping trick (x^=y^=x) for each of the two 16 bit segments but I think the code is a little bit broken. I can't see how that second bit works. -----Original Message----- From: brian sharon <br...@hu...> To: gda...@li... <gda...@li...> Date: Tuesday, 18 July 2000 12:02 Subject: Re: [Algorithms] Byte Swapping > >> From: Charles Bloom <cb...@cb...> >> >> Jumping in late : I'm sure you don't need it now, but >> here's a crazy ANSI C byte-swapper : >> >> let x = a 32 bit ulong , ABCD >> then y = DCBA >> >> y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); >> > >wow, I'll say that's crazy...but unfortunately non-functional. see the >results of this program: > >#include <stdio.h> > >long swap1(long x) >{ > return (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); >} > >long swap2(long x) >{ > return ((x >> 24) & 0x000000FF) > | ((x >> 8 ) & 0x0000FF00) > | ((x << 8 ) & 0x00FF0000) > | ((x << 24) & 0xFF000000) > ; >} > >int main(int argc, char **argv) >{ > long test = 0x01020304; > > printf("swap1: 0x%08X 0x%08X 0x%08X \n", test, swap1(test), >swap1(swap1(test))); > > printf("swap2: 0x%08X 0x%08X 0x%08X \n", test, swap2(test), >swap2(swap2(test))); >} > >swap1: 0x01020304 0x07000300 0x03000700 >swap2: 0x01020304 0x04030201 0x01020304 > > > >anyway, in case anyone hasn't gotten their fill of this stuff, here is our >comparatively lame byteswapping code that uses those fast swappers on >PowerPC: > >#ifndef _MBSWAP_H_ >#define _MBSWAP_H_ > >// swapping macros/inlines >#include <Runtime/MBBase.h> > >inline MBint16 MBSwap(const MBint16 & swap) >{ >#if defined(MB_MAC) && defined(MB_POWERPC) > return __lhbrx(const_cast<MBint16 *>(&swap), 0); >#else > return ((swap >> 8 ) & 0x00FF) > | ((swap << 8 ) & 0xFF00) > ; >#endif >} > >inline MBuint16 MBSwap(const MBuint16 & swap) >{ >#if defined(MB_MAC) && defined(MB_POWERPC) > return __lhbrx(const_cast<MBuint16 *>(&swap), 0); >#else > return ((swap >> 8 ) & 0x00FF) > | ((swap << 8 ) & 0xFF00) > ; >#endif >} > >inline MBint32 MBSwap(const MBint32 & swap) >{ >#if defined(MB_MAC) && defined(MB_POWERPC) > return __lwbrx(const_cast<MBint32 *>(&swap), 0); >#else > return ((swap >> 24) & 0x000000FF) > | ((swap >> 8 ) & 0x0000FF00) > | ((swap << 8 ) & 0x00FF0000) > | ((swap << 24) & 0xFF000000) > ; >#endif >} > >inline MBuint32 MBSwap(const MBuint32 & swap) >{ >#if defined(MB_MAC) && defined(MB_POWERPC) > return __lwbrx(const_cast<MBuint32 *>(&swap), 0); >#else > return ((swap >> 24) & 0x000000FF) > | ((swap >> 8 ) & 0x0000FF00) > | ((swap << 8 ) & 0x00FF0000) > | ((swap << 24) & 0xFF000000) > ; >#endif >} > >inline MBfloat MBSwap(const MBfloat & swap) >{ > MBuint32 temp = *(const MBuint32*)&swap; > temp = MBSwap(temp); > return *(const MBfloat *)&temp; >} > >#ifdef MB_MSB > > #define MBSwapMSBToNative( s ) s > #define MBSwapNativeToMSB( s ) s > > #define MBSwapLSBToNative MBSwap > #define MBSwapNativeToLSB MBSwap > >#elif defined(MB_LSB) > > #define MBSwapLSBToNative( s ) s > #define MBSwapNativeToLSB( s ) s > > #define MBSwapMSBToNative MBSwap > #define MBSwapNativeToMSB MBSwap > >#endif > >#endif // header guard > > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: brian s. <br...@hu...> - 2000-07-18 02:00:08
|
> From: Charles Bloom <cb...@cb...> > > Jumping in late : I'm sure you don't need it now, but > here's a crazy ANSI C byte-swapper : > > let x = a 32 bit ulong , ABCD > then y = DCBA > > y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); > wow, I'll say that's crazy...but unfortunately non-functional. see the results of this program: #include <stdio.h> long swap1(long x) { return (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); } long swap2(long x) { return ((x >> 24) & 0x000000FF) | ((x >> 8 ) & 0x0000FF00) | ((x << 8 ) & 0x00FF0000) | ((x << 24) & 0xFF000000) ; } int main(int argc, char **argv) { long test = 0x01020304; printf("swap1: 0x%08X 0x%08X 0x%08X \n", test, swap1(test), swap1(swap1(test))); printf("swap2: 0x%08X 0x%08X 0x%08X \n", test, swap2(test), swap2(swap2(test))); } swap1: 0x01020304 0x07000300 0x03000700 swap2: 0x01020304 0x04030201 0x01020304 anyway, in case anyone hasn't gotten their fill of this stuff, here is our comparatively lame byteswapping code that uses those fast swappers on PowerPC: #ifndef _MBSWAP_H_ #define _MBSWAP_H_ // swapping macros/inlines #include <Runtime/MBBase.h> inline MBint16 MBSwap(const MBint16 & swap) { #if defined(MB_MAC) && defined(MB_POWERPC) return __lhbrx(const_cast<MBint16 *>(&swap), 0); #else return ((swap >> 8 ) & 0x00FF) | ((swap << 8 ) & 0xFF00) ; #endif } inline MBuint16 MBSwap(const MBuint16 & swap) { #if defined(MB_MAC) && defined(MB_POWERPC) return __lhbrx(const_cast<MBuint16 *>(&swap), 0); #else return ((swap >> 8 ) & 0x00FF) | ((swap << 8 ) & 0xFF00) ; #endif } inline MBint32 MBSwap(const MBint32 & swap) { #if defined(MB_MAC) && defined(MB_POWERPC) return __lwbrx(const_cast<MBint32 *>(&swap), 0); #else return ((swap >> 24) & 0x000000FF) | ((swap >> 8 ) & 0x0000FF00) | ((swap << 8 ) & 0x00FF0000) | ((swap << 24) & 0xFF000000) ; #endif } inline MBuint32 MBSwap(const MBuint32 & swap) { #if defined(MB_MAC) && defined(MB_POWERPC) return __lwbrx(const_cast<MBuint32 *>(&swap), 0); #else return ((swap >> 24) & 0x000000FF) | ((swap >> 8 ) & 0x0000FF00) | ((swap << 8 ) & 0x00FF0000) | ((swap << 24) & 0xFF000000) ; #endif } inline MBfloat MBSwap(const MBfloat & swap) { MBuint32 temp = *(const MBuint32*)&swap; temp = MBSwap(temp); return *(const MBfloat *)&temp; } #ifdef MB_MSB #define MBSwapMSBToNative( s ) s #define MBSwapNativeToMSB( s ) s #define MBSwapLSBToNative MBSwap #define MBSwapNativeToLSB MBSwap #elif defined(MB_LSB) #define MBSwapLSBToNative( s ) s #define MBSwapNativeToLSB( s ) s #define MBSwapMSBToNative MBSwap #define MBSwapNativeToMSB MBSwap #endif #endif // header guard |
From: Aaron D. <ri...@ho...> - 2000-07-18 01:58:58
|
I'm assuming you're not after portability here. Off the top of my head you could use an assembler snippet like below. Its in x86. I'm not sure if there is a mac equiv of the xchg instruction but if thats not supported its 3 xors for each. The code below doesn't rely on bswap. mov ebx,eax shr ebx,16 xchg al,ah xchg bl,bh shl eax,16 or eax,ebx -----Original Message----- From: Conor Stokes <cs...@tp...> To: gda...@li... <gda...@li...> Date: Tuesday, 18 July 2000 11:19 Subject: Re: [Algorithms] Byte Swapping > >> Errr............ you'd better use the BSWAP instruction........ same >result >> with one line of assembly............ >> >BSWAP is an x86 instruction :) Not much good if you wanna swap bytes on the >Mac. > >Possibly there is a Mac equivelent, but I think it is RISC practice to avoid >such instructions. > >Conor Stokes > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Conor S. <cs...@tp...> - 2000-07-18 01:18:33
|
> Errr............ you'd better use the BSWAP instruction........ same result > with one line of assembly............ > BSWAP is an x86 instruction :) Not much good if you wanna swap bytes on the Mac. Possibly there is a Mac equivelent, but I think it is RISC practice to avoid such instructions. Conor Stokes |
From: Michael S. H. <mic...@ud...> - 2000-07-17 23:18:40
|
Just for good measure, here's ours /* useful macros for swapping 16 and 32 bit data types */ #define MAKE16(l, h) ((Uint16)(((Byte)(l)) | ((Uint16)((Byte)(h))) << 8)) #define MAKE32(l, h) ((Uint32)(((Uint16)(l)) | ((Uint32)((Uint16)(h))) << 16)) #define LO16(l) ((Uint16)(l)) #define HI16(l) ((Uint16)(((Uint32)(l) >> 16) & 0xFFFF)) #define LO8(w) ((Byte)(w)) #define HI8(w) ((Byte)(((Uint16)(w) >> 8) & 0xFF)) /* these assume that the swapping is from motorola to intel format */ #if __cplusplus #if NEEDBYTESWAP inline Int16 ByteSwap( Int16 &x ) { Uint16 y = (Uint16)x; y = (Uint16)(y >> 8 | (y << 8 & 0xff00)); x = (Int16 &)y; return x; } inline Uint16 ByteSwap( Uint16 &x ) { x = (Uint16)(x >> 8 | (x << 8 & 0xff00)); return x; } inline Int32 ByteSwap( Int32 &x ) { Uint32 y = (Uint32)x; y = y >> 24 | (y >> 8 & 0xff00) | (y << 8 & 0xff0000) | (y << 24 & 0xff000000); x = (Int32 &)y; return x; } inline Uint32 ByteSwap( Uint32 &x ) { x = x >> 24 | (x >> 8 & 0xff00) | (x << 8 & 0xff0000) | (x << 24 & 0xff000000); return x; } template<class T> inline T ByteSwap( T &parm ) { Uint32 x = (Uint32)parm; x = x >> 24 | (x >> 8 & 0xff00) | (x << 8 & 0xff0000) | (x << 24 & 0xff000000); parm = (T &)x; return parm; } inline float ByteSwap( float &x ) { Uint32 * pTemp = (Uint32*)&x; Uint32 y = *pTemp; y = y >> 24 | (y >> 8 & 0xff00) | (y << 8 & 0xff0000) | (y << 24 & 0xff000000); pTemp = (Uint32*)&y; x = *((float*)pTemp); return x; } inline double ByteSwap( double &x ) { Uint32 * pParm = (Uint32*)&x; Uint32 nFirst = pParm[0]; Uint32 nSecond = pParm[1]; ByteSwap( nFirst ); ByteSwap( nSecond ); pParm[0] = nSecond; pParm[1] = nFirst; return x; } #else #define ByteSwap(x) (x) #endif #endif /* __cplusplus */ At 03:41 PM 7/17/00, you wrote: >Jumping in late : I'm sure you don't need it now, but >here's a crazy ANSI C byte-swapper : > >let x = a 32 bit ulong , ABCD >then y = DCBA > >y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); > >At 11:45 PM 7/15/2000 -0700, you wrote: >>I can do the obvious method, but I was wondering if anyone have any >>cool/fast code snippets for byte swapping integers and floats? >> >>Tom >> >> >>_______________________________________________ >>GDAlgorithms-list mailing list >>GDA...@li... >>http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list >> >> >-------------------------------------- >Charles Bloom www.cbloom.com > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Pierre T. <p.t...@wa...> - 2000-07-17 23:11:47
|
Errr............ you'd better use the BSWAP instruction........ same result with one line of assembly............ Pierre ----- Original Message ----- From: Charles Bloom <cb...@cb...> To: <gda...@li...> Sent: Tuesday, July 18, 2000 12:41 AM Subject: Re: [Algorithms] Byte Swapping > > Jumping in late : I'm sure you don't need it now, but > here's a crazy ANSI C byte-swapper : > > let x = a 32 bit ulong , ABCD > then y = DCBA > > y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); > > At 11:45 PM 7/15/2000 -0700, you wrote: > >I can do the obvious method, but I was wondering if anyone have any > >cool/fast code snippets for byte swapping integers and floats? > > > >Tom > > > > > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDA...@li... > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > -------------------------------------- > Charles Bloom www.cbloom.com > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Charles B. <cb...@cb...> - 2000-07-17 22:42:12
|
Jumping in late : I'm sure you don't need it now, but here's a crazy ANSI C byte-swapper : let x = a 32 bit ulong , ABCD then y = DCBA y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); At 11:45 PM 7/15/2000 -0700, you wrote: >I can do the obvious method, but I was wondering if anyone have any >cool/fast code snippets for byte swapping integers and floats? > >Tom > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > -------------------------------------- Charles Bloom www.cbloom.com |
From: Scott B. <Sc...@Ma...> - 2000-07-17 22:01:33
|
I just bought it. You can create some nice looking stills, but for creating particles...It sucks. Try, I think it's the Genesis?? plugin for Photoshop or Flare effects from Axion Software is the one I use mostly. Can do single flare sprites and has lots and lots of settings. Little bit buggy, but nothing you can't get around, and is cheap... Happy Flaring... ----- Original Message ----- From: Daniel Renkel <dan...@ho...> To: <gda...@li...> Sent: Monday, July 17, 2000 5:07 PM Subject: RE: [Algorithms] Particles system > hi guys, > > look under > http://www.diardsoftware.com/ > for more informations... > > cu, re...@ma... > > > >From: Matthew Davies <MD...@ac...> > >Reply-To: gda...@li... > >To: "'Algorithms List'" <alg...@3d...> > >Subject: RE: [Algorithms] Particles system > >Date: Mon, 17 Jul 2000 10:10:40 +0100 > > > >Hi Kurt, > > > >I'd had a quick look (as Im busy at the mo') for this program 'Universe' > >but > >have not been able to find it. Do you have a URL, perhaps? > > > >Cheers, > >Matt. > > > > > > > -----Original Message----- > > > From: Kurt Miller [mailto:ku...@fl...] > > > Sent: Friday, July 14, 2000 17:40 > > > To: Algorithms List > > > Subject: Re: [Algorithms] Particles system > > > > > > > > > > > > >>to create textures for special effects (flares, explosions, > > > energy beans, > > > >>Does someone know a good tool to create the textures? Or > > > some algoritm, so > > > I > > > >>can create then by myself? > > > > > > You may want to check out a program called "Universe", which > > > is shareware. > > > It makes the creation of flares, coronas, nebulae etc point-and-click > > > simple, with plenty of parameters to alter. You can run a search on > > > hotfiles.com for the demo version. > > > > > > As for explosions and sparks, I've seen a few CDs for sale, > > > with photo- > > > realistic (ie, sampled from film) explosion animations and such. > > > Perhaps you should search around for something like that. > > > > > > HTH > > > > > > > > > Kurt Miller > > > 3D Coder/Enthusiast > > > http://www.flipcode.com > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > To unsubscribe from this list, send an e-mail to > > > "do...@3d..." with the following body: > > > > > > leave algorithms > > > > > > Web Archives of this list can be found at: > > > http://216.101.212.117/cgi/doweb.exe?list=algorithms > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > > > > > > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDA...@li... > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > ________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Daniel R. <dan...@ho...> - 2000-07-17 21:07:28
|
hi guys, look under http://www.diardsoftware.com/ for more informations... cu, re...@ma... >From: Matthew Davies <MD...@ac...> >Reply-To: gda...@li... >To: "'Algorithms List'" <alg...@3d...> >Subject: RE: [Algorithms] Particles system >Date: Mon, 17 Jul 2000 10:10:40 +0100 > >Hi Kurt, > >I'd had a quick look (as Im busy at the mo') for this program 'Universe' >but >have not been able to find it. Do you have a URL, perhaps? > >Cheers, >Matt. > > > > -----Original Message----- > > From: Kurt Miller [mailto:ku...@fl...] > > Sent: Friday, July 14, 2000 17:40 > > To: Algorithms List > > Subject: Re: [Algorithms] Particles system > > > > > > > > >>to create textures for special effects (flares, explosions, > > energy beans, > > >>Does someone know a good tool to create the textures? Or > > some algoritm, so > > I > > >>can create then by myself? > > > > You may want to check out a program called "Universe", which > > is shareware. > > It makes the creation of flares, coronas, nebulae etc point-and-click > > simple, with plenty of parameters to alter. You can run a search on > > hotfiles.com for the demo version. > > > > As for explosions and sparks, I've seen a few CDs for sale, > > with photo- > > realistic (ie, sampled from film) explosion animations and such. > > Perhaps you should search around for something like that. > > > > HTH > > > > > > Kurt Miller > > 3D Coder/Enthusiast > > http://www.flipcode.com > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > To unsubscribe from this list, send an e-mail to > > "do...@3d..." with the following body: > > > > leave algorithms > > > > Web Archives of this list can be found at: > > http://216.101.212.117/cgi/doweb.exe?list=algorithms > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > > > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com |
From: Aldo . <al...@ho...> - 2000-07-17 18:00:02
|
Thank you, Steve! Aldo >From: Steve Wood <Ste...@im...> >Reply-To: gda...@li... >To: "'gda...@li...'" ><gda...@li...> >Subject: RE: [Algorithms] Creating the world matrix >Date: Mon, 17 Jul 2000 09:47:51 -0700 > > > From: Aldo . [mailto:al...@ho...] > > > > I'm looking for a fast way to create the world matrix from > > the values of pitch, yaw, roll and position(and scaling factor, >perhaps), > > without using a matrix operation for each value. > > I would like to avoid do the folowing > > > > WorldMatrix = MatrixIdentity(); > > > > MatrixScale(WorldMatrix, scale); > > > > MatrixTranslate(WorldMatrix, position); > > > > MatrixRotateX(WorldMatrix, pitch); > > MatrixRotateY(WorldMatrix, yaw); > > MatrixRotateZ(WorldMatrix, roll); > > > > SetWorldMatrix(WorldMatrix); > > > >In the DirectX help Index select: 3-D Transformations. It has details on >the matrices used for each method you list. If you want to hard code it >into >your app to eliminate un-necessary operations then you'll want to break >each >transform operation down to it's components and do the math. > >R&R > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com |
From: Steve W. <Ste...@im...> - 2000-07-17 16:53:35
|
> From: Aldo . [mailto:al...@ho...] > > I'm looking for a fast way to create the world matrix from > the values of pitch, yaw, roll and position(and scaling factor, perhaps), > without using a matrix operation for each value. > I would like to avoid do the folowing > > WorldMatrix = MatrixIdentity(); > > MatrixScale(WorldMatrix, scale); > > MatrixTranslate(WorldMatrix, position); > > MatrixRotateX(WorldMatrix, pitch); > MatrixRotateY(WorldMatrix, yaw); > MatrixRotateZ(WorldMatrix, roll); > > SetWorldMatrix(WorldMatrix); > In the DirectX help Index select: 3-D Transformations. It has details on the matrices used for each method you list. If you want to hard code it into your app to eliminate un-necessary operations then you'll want to break each transform operation down to it's components and do the math. R&R |
From: Scott M. <sc...@3d...> - 2000-07-17 14:13:58
|
My apologies, that last was meant for the original poster, not the list. |
From: Paul D. <P_d...@cr...> - 2000-07-17 14:13:41
|
Have a look here http://www.acm.org/tog/GraphicsGems/gems/MatrixPost.c it's not quite what you want but it might help. -----Original Message----- From: Aldo . [mailto:al...@ho...] Sent: Monday, July 17, 2000 3:00 PM To: gda...@li... Subject: [Algorithms] Creating the world matrix Hi! I'm looking for a fast way to create the world matrix from the values of pitch, yaw, roll and position(and scaling factor, perhaps), without using a matrix operation for each value. I would like to avoid do the folowing WorldMatrix = MatrixIdentity(); MatrixScale(WorldMatrix, scale); MatrixTranslate(WorldMatrix, position); MatrixRotateX(WorldMatrix, pitch); MatrixRotateY(WorldMatrix, yaw); MatrixRotateZ(WorldMatrix, roll); SetWorldMatrix(WorldMatrix); Yes, I know the code is not efficient, and perhaps wrong, but its only a example. I'm using D3D Immediate Mode. Any ideas? Thanks in advance. Aldo ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Scott M. <sc...@3d...> - 2000-07-17 14:13:10
|
This question would probably be more welcome on the Software Engineering Gamedev list (sweng-gamedev). Here's the info for it in case you're interested. ------------------------------------------------ Welcome to the sweng-gamedev mailing list! Please save this message for future reference. Thank you. If you ever want to remove yourself from this mailing list, you can send mail to <Maj...@in...> with the following command in the body of your email message: unsubscribe sweng-gamedev or from another account, besides sc...@3d...: unsubscribe sweng-gamedev sc...@3d... If you ever need to get in contact with the owner of the list, (if you have trouble unsubscribing, or have questions about the list itself) send email to <own...@in...> . This is the general rule for most mailing lists when you need to contact a human. Here's the general information for the list you've subscribed to, in case you don't already have it: The Game Software Engineering List Charter ========================================== Welcome to SwEng-Gamedev! This list is provided as a forum for game developers to discuss and develop software engineering strategies for developing their engines. Discussion of game patterns and other abstractions is heartily encouraged! Case studies (unless in violation of an NDA!) are also a welcome way to learn -- a game-engine autopsy of sorts. Discussions of lower-level programming issues like individual algorithms and their implementation is generally discouraged. However, there are exceptions; if an algorithm is of a broad enough scope that it deserves abstractions in its implementation, for instance, it's worth discussing. And nobody likes a list plagued by people shouting "OFF-TOPIC! GET OUT!" so let's generally try to allow for a little wiggle room in discussions. Furthermore, as C/C++ are the primary languages used today for game development, discussions of patterns will likely use reference implementations or example headers in one of these languages. Other languages are certainly welcome, but before writing up an example in Prolog, consider how useful it'll be to most of the list. Furthermore, this isn't an appropriate place to evangelize your favorite obscure language. Also, as alluded to above, it's important that discussions take intellectual property laws and professionalism into account. For every subscriber, the following rules apply: 1) Your company must know you are on this list. 2) Assume all things you say on this list will be public. 3) No open recruiting. Hopefully, by sticking to these, we'll keep discussing both smoothly flowing and also legal! To send mail to the list, send to 'swe...@in...'. Enjoy! |
From: Aldo . <al...@ho...> - 2000-07-17 14:01:01
|
Hi! I'm looking for a fast way to create the world matrix from the values of pitch, yaw, roll and position(and scaling factor, perhaps), without using a matrix operation for each value. I would like to avoid do the folowing WorldMatrix = MatrixIdentity(); MatrixScale(WorldMatrix, scale); MatrixTranslate(WorldMatrix, position); MatrixRotateX(WorldMatrix, pitch); MatrixRotateY(WorldMatrix, yaw); MatrixRotateZ(WorldMatrix, roll); SetWorldMatrix(WorldMatrix); Yes, I know the code is not efficient, and perhaps wrong, but its only a example. I'm using D3D Immediate Mode. Any ideas? Thanks in advance. Aldo ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com |
From: Stephen J B. <sj...@li...> - 2000-07-17 13:31:08
|
On Sat, 15 Jul 2000, Matt Adams wrote: > I got a question about the C++ class hierarchy. NO, NO, NO!!! OFF TOPIC!!! Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |
From: Stephen J B. <sj...@li...> - 2000-07-17 13:28:03
|
On Sat, 15 Jul 2000, gl wrote: > > I'm doing this publically Tom to get a consensus (or otherwise). Can we > change the subject list title to be shorter? Right now it eats too much > subject real-estate. > > I suggest simply [GDAlgos-List], and if poss. drop the GD too. It might not > seem like much, but it matters to me (opinions?). The '-List' part seems pretty redundant too. [Algorithms] would be best IMHO. Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |