Voxel Draw
- 5 Devlogs
- 4 Total hours
a app that intends to make Voxel designs simpler, easier and much more convenient ! since its made using Electron, it works universally too!
a app that intends to make Voxel designs simpler, easier and much more convenient ! since its made using Electron, it works universally too!
Whilst building the actual voxel renderer, it seems i may or may not have encountered a totally splendid error that changed my perspective on the whole rendering process, the Gimble lock.
I was using a Perspective camera in the 3js canvas, and very recently i tried to implement rotation (mouse rotation, i havent figured out animated gestures YET)
and it seemed at some point the camera only moved on 2 axis and refused to move on the other one, i just lost 1 degree of rotation? the fix is something completely out of pocket (istg this didnt make sense to me till like i pulled out my old project and tried sum shi) we use quaternions!? so basically real number is in the form
A(a)=a //real num
A(a,b)=a+bi //complex num
vvv
A(a,b,c,d)=a+bi+cj+dk //quaternions
as complex numbers we know, a and b are real numbers and i is the complex unit. (can represent 2d vectors)
In quaternions, were showing a 4d vector, end of story? no (sadly) then why not use trinions? or why even use polynions?
in complex plane we know the imaginary unit i is root(-1), vectorwise, we know a+ib, where a is the x unit and b is y unit basically (a,b) vector. where things like rotation by 90deg and stuff can be done easily as i^2=-1, so we can exchange between the initial x representator and y representator. there is no 3 way of 1,i,j that ever works this way so trinions arent a thing, …but quaternions CAN behave similarly
A(a,b,c,d)=a+bi+cj+dk…if we take a=0, A(b,c,d)=bi+cj+jk would u look at that? it suddenly represents a 3d vector. Although learning this was very informative, 3jd does have quaternions inbuilt so i didnt have to necessarily add anything extra, so all i had to do was implement quaternion based stepping rotation and voila! no gimble lock
For now, all ive done is refactored the code because implementing new features has been going very wrong, and also readability was at a all time low. Ive also implemented a few gestures already including pinch, isFIngerStraight and finger node angles
Finally i added a THREE js canvas overlay on top of my ml hand canvas (ill check which is better on top later on) and after some 3js investigation i can render a cube! now ive yet to discover the other functionalities and the gestures are still have a long way to go but theyre working out pretty decently
I finally added a full structure for gestures, and also made the video and canvas FULLY responsive 🤑🤑🤑🤑🤑 ive been working on the 3js thing on the side reading documentation and other repos and whatnot, and looks like its gonna take some time for me to add the voxel drawing features, but till then i do have the gestures to worry about. also face detection doesnt work if you stick your tongue out 💔💔🥀🥀
This is a very cool experience for me, as all the ml experimentations ive done were done with python, with js i can ship it as an app so its cool. but basically, im tryna make a minecraft build maker using just ur hands, and hopefully export it too! the ml model is working (barely, all gestures are made by myself cuz no out of the box support.) and i also have no idea how to stack 3js on top of ts. (although i have my own software rasterizer, i need sum fast and reliable and actually uses the gpu)