Results for "Author: robert rayment"
A386 machine code collection by Robert Rayment. 1. Simple examples 2. Fractals. 3. PicBox1 4. PicBox2. All using the A386 assembler. Win 98, Zip 173 KB
Creating & testing an assembler DLL using NASM, a freeware assembler. The demonstration DLL does Bit testing, shifting, rotating, clearing & setting.
Finds words starting with, containing, ending with, >
I love pencil drawing and there's nothing to beat pencil and paper. On the computer the mouse never moves as easily as a pencil but mathematics does allow some types of drawing to be carried out much more quickly than would be possible by hand. This is a pencil drawing programme with 256 shades of grey. It has 21 drawing tools and a host of sub-tools all easily selected from on-screen toolbars. Many shaded shapes such as curved lines, tubes, cones etc can be drawn. All the standard picture formats can be loaded or added and re-positioned. Saving is either as a BMP or a JPG file. Any rectangular part of the picture can be saved. JPG saving and printing is accomplished by using a single exe, free-standing, freeware conversion program that takes a command line and is hence easily used in VB. The source and credits for this are included in the .zip file In addition to the tools there is a zoom facility, whole-picture scrolling, +, X & perspective hair-lines, settable brick & tile sizes, text with any font, size or angle, undo and two canvas sizes suitable for A4 paper. All the source files, including button bitmaps, are included. The .zip file is just over 1MB and the program is written for an 800x600 screen.
RR3D: Displays a rotatable and scaleable wire frame of any 3D mathematical function. This can be made up from the normal VB maths plus inverse and hyperbolic functions. Functions can be created and saved as wanted. Image vertices can also be saved for use elsewhere. The MS ScriptControl Eval function simplifies calculations enormously and its use is demonstrated. Also shown are MoveToEx, LineTo which are much faster than the VB equivalents and very easy to use. Included are a set of string handling subroutines such as count characters, squeeze out spaces, replace sub-strings etc. Commented throughout including the 3D maths and perspective methods. All the files are visible and the program is written for an 800x600 screen.
16 Million Colors DLL. Example of a straightforward DLL, written with NASM, to cycle through all possible colors quickly. For 24-bit color only. All source code included. Zip file 8.5KB.
VB, Assembler & Resource files by Robert Rayment (see small update below) Only those interested in this topic should download these files. If you have been following some of the VB+assembler progs I've been putting on PSC you may have noticed that the assembly part is either in a bin file (com in earlier examples) or in a DLL. The disadvantage of both these is that they need to be in the same folder as the prog. This is OK for testing but is a nuisance for an EXE. Also we're usually talking about small bits of assembler to beef up parts of VB (Heineken approach). The DLL may be specific and so is not appropriate to register. Assembled snippets are often much faster than VB. Also, once you've got over the red-tape and peculiarities of the particular assembler, its often _easier_ (this may be a secret so don't tell anyone) A DLL has a minimum size of 16KB and a bin file 4KB (cluster size). What this submission shows is how to put your assembler code into a resource file which gets incorporated into an EXE freeing it from associations and only taking a few more bytes than the bin file size. A 32-bit Hex/Long integer/Binary converter is developed to demonstrate these techniques. The zip file is ~11KB. UPDATE: it is possible to simplify the load from res by InCode = LoadResData(101, "CUSTOM") lpMCode = VarPtr(InCode(0)) avoiding the save to disc. Make sure to delete the line lpMCode = VarPtr(InCode(1))
VTrack2 by Robert Rayment This program uses floor ray-casting from the eye onto a color-height byte array (ie for simplicity avoiding separate height & color maps). The color-heights are then projected back to a front surface byte array which blitted to the screen using the API StretchDIBits. The program can be run with or without machine code and it runs for any screen size or color setting There is an automatic mode which goes round a track once with timing. In the VB environment this takes about 300 secs, VB EXE takes between 35 and 65 secs depending on Voxel heights and machine code bewteen 12 and 24 secs on my 400 MHz computer. Controls are the cursor keys to move forward, backward, turn to the left and turn to the right. With Shift the up & down arrows change the height of objects and Ctrl with the up & down arrows moves the viewer up & down. The SPACE bar brings the motion to an immediate halt. With the Pyramids a wall forms a boundary around the surface but with Plasmas the surface rolls over giving continuous motion. There is also collision detection based on the eye coords and the Voxel height in the vicinity on the floor surface. Different palettes can be selected and they take effect immediately. Changing the motion control or surface type requires the START button to be pressed. The casting routine is modified from that of D Brebner's of Unlimited Realities. In particular a spherical correction is applied and the scanning is from -ve to +ve angles placing the viewer in the middle of the screen. The FloorCASTER routine is commented in detail - the effects are very subtle. The machine code routines are in a bin file for use with CallWindowsProc but could easily be converted to a DLL. See also the recent prog from NLS, on PSC, which shows an alternative method for Voxels with 24-bit color. The ZIP file is 40 KB. (ADDITIONS Switch smoothing, plateau surface, collision flash, no collision in clouds).
A Dash Through the Woods by Robert Rayment. UPDATE: Improved bitmap creation (Having been goaded by Paul) plus some simple sound. This prog is based on the triplet StretchDIBits, byte arrays and assembler (as with 'Tunnels & Things' which got 10 excellent votes) except I've left out the assembler which means that it MUST be compiled so that the array manipulations are again dealt with by machine code. The prog will only produce a large bitmap file of smaller trees from a starting bitmap ONCE so that later runs can load up the byte arrays quickly. The creation of the bit maps is fast enough now so you could leave out the save to disk if you wanted to. It shows some other uses for StretchDIBits and 8-bit color byte surfaces, which might be of interest to some of you. No assembler is used. Trees are then put onto a drawing surface starting with the smallest and ignoring a white surround (masks not needed). By keeping and adjusting the x-position, direction and type of tree it looks like moving through some woods. Timing (using GetTickCount) and hence speed, the number of tree starts and their spread are on an options menu. The left & right cursor moves a little car to the left & right (actually the trees move in the opposite direction) and the up & down cursor changes the speed. You have to try not to hit the trees. Collision detection is based on x-coords. It needs compiling to an EXE to get a decent speed. Don't expect DirectX quality but I think its fun! The Zip file is 54 KB.
Spirals by Robert Rayment. Chris and I were looking at some spirals and I've animated a few for your pleasure (if you like that kind of thing!). See 'Tunnels & Things' for the techniques. Win98 only. Zip file 24 KB.
Tunnels & Things by Robert Rayment: The simplicity of this appeals to me. Draw to a byte array and blit it to the form using StretchDIBits. The advantage of StretchDIBits is that it can take a pointer to the byte drawing surface and to a palette. It can be as close as VB gets to direct screen addressing similar to the old DOS Screen 13, only better. It is no competitor to DirectX but is very much simpler and pretty fast. The demonstration shows various tunnels, MMX scrolling, Plasma, Fire etc. Drawing is done using VB and animation using assembler (assembler doesn't have to be used but I prefer it). Win98 only. Zip file is 63KB.
File Format Viewer & Editor (FFVe) by Robert Rayment. (Update 6 Apr 2008) The purpose of this program is to be able to view any file, particularly binary files, in an easily read format, ie as characters, bytes, integers and longs as decimal or hex. Format changes are set out on a new line with different colors and can be saved in a template file. Also loading in a template file will automatically parse the display. Numbers or characters can be editted and the new file saved. There is unlimited undo. Search & Mark, Goto and Highlighting is included. The displayed page can be printed and placing a shortcut of the EXE in the Windows SendTo folder will enable any file to be sent to this program or dropped onto a DeskTop shortcut. Some simple samples (made with this program) for ico, cur, bmp, gif, png, jpeg and RIFF palette files are included. There is a DEMO button to show the main functions... __________________________________________________ Update 6 Apr:...Added variation to Slider, see screenshot. Plus a few other tweaks, see Form1. __________________________________________________ Upgrade 5 Apr:...1..Added ASCII Panel..2..Added Animated navigation..3..Added Slider for large files. __________________________________________________ (Update 1 Apr:.. Correct a zero divide error and allow for line numbers >= 10,000,000)...(Update 31 Mar:..Extended for higher screen resolutions). See Form1 for other changes. Zip 92KB.
Mini-Fractal Painter by Robert Rayment. (Correction for no drive) (Additions: Faster string-byte handling + DrawWidth) The starting point for this was Loreno Heer's LSystems prog on PSC, where the VB6 Replace function is used to develop the LSys strings. The trees' & plants' size, complexity, color & orientation can be varied. See screen shot which was made in just a few seconds. This prog could easily be extended to include other functions (I've resisted doing that and have only included those necessary to produce a picture like the screenshot) or the methods could be added to an existing VB paint program. VB or ASM can be used to translate the LSys strings and draw to the screen. Win98, Zip 55KB.
Plasma Tunnels by Robert Rayment. (Now maximizable) VB+ASM. Win98 (see Plasma Worlds for other uses of plasmas) Zip 27KB
Spinning Illusions by Robert Rayment. (Small change, hopefully more stable on other OS than Win98) Just a bit of VB doodling, 8 shapes with odd effects. [ Shaped form & picbox, +/- rotation anti-alias rotation, VBASM, Res wav ]. Zip 100 KB, Win98.
Plasma Worlds by Robert Rayment. (Cylindrical tunnel added to ASM version)Two progs. One, pure VB (no APIs or OCXs) for making plasma screens that can be saved as a bmp, bit slow but adequate when compiled. Plasma uses a non-recursive routine on to any rectangle and can be wrapped for tiling. Graininess, scale & color palettes can be changed. The other prog is the same PLUS scrolling in 16 directions, color cycling, cylindrical, spherical & hyperbolic wrapping and fantasy landscape projections all with multiple controls - VB+APIs+ASM, much faster. Only tested on Win98, should be OK on ME & XP but some Win2K OSs have problems with this use of Assembler. Please let me know your OS if you find bugs. Zip 79KB.
Knots by Robert Rayment. Load knots, Save knots (*.knt files), Make a knot (colored cursor, + hairs, grid). Examples KNOTS.knt (20 knots drawn using this prog) & Hello.knt included. See also KnotsInfo.txt. Zip 21KB, Win98.
Shove H'Penny by Robert Rayment. (Updated for XP)An old English pub game. The full rules are applied including illegal moves - see help file. The hardest part was getting a reasonable collision between disks: a bit of distorted Newton plus blitting, constructive comments on this welcome. Win98, Zip file 56 kb.
"Anti-aliasing demo" by Robert Rayment. There are a few anti-aliasing progs on PSC. Mostly they are cleverly convoluted into several subs. I thought I'd stretch out the logic - makes it easier for me to understand and maybe for some of you.
"A Lotta Noise" by Robert Rayment: (UPDATE2 Cycle speed added) (UPDATE with faster linear Perlin & Marble) This is a demonstration of 32-bit StretchDIBits which can be run as VB code or VB + machine code. Perlin noise (Linear or Cosine-EASE), wood grain and marble surfaces can be designed on a picture box varying from 16x16 to 768x512 pixels. Color weighting, scales, wood and marble types, animated scales and color cyling can be done and the image saved, as a BMP, at any point. The prog can be run with any system color setting. A long integer graphic surface has the advantage in that it can more easily be dealt with using MMX. This demo is just the 'tip of the iceberg' but the method might be useful for designing textures for any application since the machine code is quite general and the bin file can be run locally. Zip file 38 kb.