Flag Bitmap Effect
by Frank Bignone · 08/08/2002 (10:44 am) · 4 comments
Download Code File
This simple control allows you to display a moving texture in 3D (like a flag).
To install it, just copy the file under src in your gui folder, and compile torque. Then you may add the following control:
The bitmap file is the texture which will be applied on a set of rectangle patches. These patches will then move by following a sine function.
The sine frequency and amplitude are hard-coded, but you may easily set this as parameters (I did not have time to do it and as I promise to post this control, i rush a little bit the things.).
This control is also very useful if you want to know how to display 3D object in a GUI control (it is derived from TSControl).
This simple control allows you to display a moving texture in 3D (like a flag).
To install it, just copy the file under src in your gui folder, and compile torque. Then you may add the following control:
new GuiBitmapFlagCtrl(CreditFlag) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
bitmap = "~/flag.jpg";
};The bitmap file is the texture which will be applied on a set of rectangle patches. These patches will then move by following a sine function.
The sine frequency and amplitude are hard-coded, but you may easily set this as parameters (I did not have time to do it and as I promise to post this control, i rush a little bit the things.).
This control is also very useful if you want to know how to display 3D object in a GUI control (it is derived from TSControl).
About the author
Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.
#2
Thanks
08/08/2002 (5:03 pm)
What is the difference between using this resource to display a flag (in-game) and using a 3d model made in Milkshape? Just curious.Thanks
#3
08/09/2002 (1:34 am)
Basically, this ressource shows you how to use the TSControl class to make a GUI control that can display 3d objects in opengl. Almost all the other control does not set correctly the camera and projection to make 3d drawing correct. TSControl handles that correctly. If you want to display 3D models (dts file), i will suggest that you look at the tutorial on 3D object viewer gui control (which derives also from TSControl).
#4
06/01/2003 (5:54 am)
Would it be very difficult to port this to a game object rather than a GUI object ? 
Associate Stefan Beffy Moises