Wednesday, February 1, 2017

3D Rotations part 2

This post is about 3d vector rotations. It has to do with the dot and cross products. It was a complicated process but with 3 unit vectors becomes very simple to use.

.

After the file is run, it allows the user to rotate an object around the axis not the co-ordinate system.

To get a vertex rotation, multiply the vertex x,y,z by the unit vectors.


*Update: Rotations can also made with 3d reflections or with a lookat function and bezier curves. Lots of flexibility for any situation. The bezier curves can eliminate singularities in the lookat function, so can many other methods. 

Sunday, July 31, 2016

Augmented Reality for Firefox on Android

Firefox 4.4 for Android.
The Firefox orientation system has been tricky to work with, but using PORTRAIT mode with these values for alpha, beta, gamma.
Gives a glitch free Virtual Reality / Augmented Reality system.

It works with the rotation code from an earlier post.

Swap rx, ry, rz with lx, ly, lz for portrait resolution.
Un-optimized commercial build 30 fps on LG G3.

*update: Firefox deviceOrientation now works perfectly. The landscape version works on Chrome and Firefox. Can now do VR/AR in any orientation on any system.



***IMPORTANT***

Someone has a patent for GPS and VR/AR so I wouldn't recommend using GPS in games. Python and HTML5 now offer a different way to get positional data. 
Also was able to create AR without a camera with my new arcade machine.


G A M E  O V E R








Sunday, May 29, 2016

2.5D Digitizing

Has been a goal of mine for a long time to create digitized 2.5D objects. 2.5D is an engineering term for mould making, in computer graphics documents clearly state that a heightmap is a 2.5D structure.

A game sprite using Anti-photo (2003). The program takes a 2D photo and a depth image, and recreates the original 3D scene that the photo has captured.
This object was taken from the net. The model is of poor quality, the face is basically a cone. With voxels the human brain is able to overlook small discrepancies.
I will be testing depth maps from the net and posting outputs here.
Voxel power.
Background objects still have plenty of detail.
Outdoor scene.
Inaccurate depth map.

Architecture.
All structures are defined in perspective, so is non-structures (space). Space leaping is a simple greater than and less than operation.The i7 will be able to run 30fps no problems. A lookup table increased the performance from 10 fps to 60 fps. 

Saturday, February 13, 2016

Phone Gap

Just got Phonegap 0.2.1 working!

Using Windows 10, you need to allow the application through the Windows Firewall. Then you have to allow the port you are going to use through your Anti-Virus application.
Start up a desktop Wi-Fi hotspot and connect phone to that. Run Phonegap Desktop, then run Phonegap Developer on phone. Enter IP and Port number and everything is running.

Wednesday, November 11, 2015

Realtime Heightmap Generation using Mandlebrot Set.

Something I read in a Fractal textbook. It had an example of Fractal compression of a photo. Output was similar to jpeg but the compression ratio was off scale.

To generate the Mandlebrot set only 3 numbers are needed. The x and y position for the centre of the output. And a depth or zoom value that magnifies the set.

As you have seen an image 1024x1024 which is 1048576 numbers can be created from 3 numbers. So far the Mandlebrot set is only good at producing dendrites. But dendrites exist in most natural structures so it's still a handy tool.

This is the best place to find dendrites.
Here is a couple of the billions there would be.


Monday, November 9, 2015

Realtime Heightmap Generation using Sandsim 3D

Was playing sugar sugar 2, a few years ago and at the time wondered if the sand simulation was done by a series of patterns or calculated.
I was able to create some code to simulate sand.

This is the 2D part of the 3D sand simulator. It is very useful for creating landscapes, it has the added benefit of settling around rocks in a natural and realistic looking way. You just need to create a basic rock landscape and the sand falls from the ceiling and covers the landscape. Creates rock cliff faces automatically.
Here is a screenshot of the first basic test to see if it worked in 3D.
 Creates nice looking dirt mounds, and ridges.

*Update: This also can be used as a very useful path finding system. A majority rule space filling CA would be more efficient.