Posts

Showing posts from 2023

MATH

Image
 The dot and cross products can be used to detect collisions between rays and AABB's. This is the cross product version. Repeat the process with another axes pair say x, z. Use the y component formula to get y1, y2, y3, y4. If either views have No collision then No collision has occured. Using only two axes pairs will fail if x and y are zero. Testing all three axes pairs eliminates this bug.  This is the dot product version, very similar to the cross product version. Using the cross product and dot product in a grid allows iso-surface extraction. I will call these iso-surfaces "Plancktons".  Marching cubes iso-surfaces. Marching cubes is basically a lookup table that converts voxels into triangle surfaces. It has 256 possible surfaces. "Plancktons" are derived from a formula and can produce billions of possible surfaces. To test for a collision between a voxel (sx, sy, sz) and a AABB use this : if(!((sx-x1>>>6)|(sy-y1>>>6)|(sz-z1>>>6)

CODE

Image
"The prevention of tyranny and the restoration of order is just" WUTZU THE MASTER,The sayings of WUTZU. CORE 2D A multi canvas multi core renderer The multi canvases stacked on top of each other. core1. js core2. js core3. js Code Editor by Rhythm Software HTTP Server by Phlox Development Output from Code Editor Output from Edge for Android Output from Opera fullscreen Offscreen canvas is working and will give a performance boost This is the worker file And this is the output Will be alot less code as well as faster rendering. I have been waiting for offscreen canvas for a decade. Writing to the canvas with a context in a web worker feels so weird. But I should get a noticeable increase in rendering speed. I like how simple it turned out to be. Just edit the canvas in the worker and the main thread canvas gets updated. This is so cool. Coolest API ever!  Navigator getGamepads was originally going to be eventhandler based. Instead they went for time slice of axes and button st

HARDWARE

Image
  "Half of everything is luck." Alec Trevelyan, Goldeneye.  Firstly if you are serious about Arduino projects, a company called Jaycar Electronics has an article titled "Arduino Power Saving and Battery Night Light". You must have this article.  Arduino Leonardo programmed to be gamepads for Windows computers. Refer to GAMELASTER on github for a better written version.  This code will turn the leonardo into a gamepad with two joysticks and 32 buttons.  Every second the 32 buttons represent 100,000 in binary and 1,000,000 in binary. The first button is the least significant bit. When I explained MAKER TECH to my uncle I used as an example, a pressure sensor that can be tapped or pressed hard like the punch pads on the old Street Fighter arcade machine. A temperature sensor could be rubbed with the thumb to generate heat to trigger an button press. A rotation sensor could simulate a reel on a fishing rod, or a steering wheel in a car. Endless possibilities!  Very usef