Results for "Author: robert rayment"
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.
Brick Play by Robert Rayment. UPDATE: picture size handle added (idea from Loc Nyguyen's VB Paint). Produces a variety of brick patterns that can be saved as BMPs. Pure and simple VB apart from a bit of blitting and a touch of timing (Assembler Not Included). Zip file 10 Kb.
Jargon Generator by Robert Rayment. Pure VB apart from timing. Uses Windings font for buttons. Auto-resize controls on width only. Scrolling text in a picture box using arrays. Jargon.txt in application folder. Zip 6KB, Win98.
PLAYOIDS Demonstrates rotatable spheres, ellipsoids, cylinders etc with and without perspective. Aspect ratio, perspective distance and animation variable on the fly.
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.
RRCalc by Robert Rayment: (UPDATE Now stays on top) Not another calculator I hear you say. But I have this one on my Office bar and find it easier to see and use than the MS Standard calc. It has the usual numbers and arithmetic operators plus square root, square, reciprocal and pi; memory clear, store, add and recall along with a window showing what's in memory. All the buttons can be operated with the mouse or the keyboard. The zip file is 31KB.
BRRIC : (Corrected for 2-color icons) This program deals with pairs of icons (16x16 & 32x32), small bitmaps and 32x32 cursors. 2 to 24-bit colors can be used depending on the image and a large number of palettes can be loaded. Many image manipulation controls are included eg drawing tools, blurr, rotate, text etc. All the controls include Tool Tip Text. My personal preference is to have as many controls on-screen rather than buried in menus. This is not to everybody's taste and the screen will look cluttered but is much quicker to use. Icons can be extracted from multiple icon files and the system icons from exe and dll files. Small 32x32 rectangles can be extracted from larger bitmaps. The use of a res file for bitmaps and binary data is demonstrated. All the files are visible and commented.
Compare Files: This simply does a byte comparison of any two files and reports whether or not they are identical. Included is the excellent Sudhir Rokades Auto Control Resizer with his information.
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.
"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.
Shows how to comment or uncomment a block of code.
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. 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.
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 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.
A PinBall Demo by Robert Rayment. UPDATED wayward pixels killed, scoring and ball capture improved. See notes in the Form. Zip file 116 Kb.
Creating & testing an assembler DLL using NASM, a freeware assembler. The demonstration DLL does Bit testing, shifting, rotating, clearing & setting.
Machine code & Fractals PLUS: (NOTE now works with 16 & 24-bit color settings though 24-bit is best for color cycling). If you are just getting into machine code (mcode) this is a tutorial and an introduction to Fractals. Fractals are well suited to mcode and covered are Mandel, Julia, Newton, Tetrate, IFS, L-Sys, Martin and Sierpinski (adapted from FRACTINT). All the Fractals are coded in both VB and mcode. Extensive use is made of the maths coprocessor. So far as possible the structures are matched so that the mcode can be followed. This doesn't always produce the most efficient code but what the mcode is doing is more important. Included are special palettes for color cycling, alternative formulae for the Julia, Tetrate and IFS Fractals and saving them as 24-bit BMPS. CallWindowProc and picture box addressing are used as shown respectively by Ulli and Non-Linear Systems Alpha24. Other introductory mcode on PSC is shown in 'Machine code (ADDITIONS)', 'Machine code & Picture Boxes' and 'Machine code & more PicBox Games'. The asm files are written for the A386 assembler.
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))