We are about to switch to a new forum software. Until then we have removed the registration on this forum.
without any 3d libraries. only code.
there is a box object that'll draw a cube.
hi koogs, sorry, but i want to do nativ 3d programming. without all the objects. if you have only 8 points of the cube and then you have to use the rotation matrixes.
Well, p5js is itself a library -- however, if you want to look at an implementation of a cube / box and then write your own, then a great place to start might be the source code for p5js box.
Check out p5.js/src/webgl/primitives.js -- starting at the line "p5.prototype.box = function()"
For examples of basic implementations of geometric functions, check out p5.js/src/webgl/p5.Geometry.js
It sounds like an assignment.
Have an array containing triplets for x, y, z (createVector?) And a list of connections between them.
Each frame, rotate each point then iterate through the connections list drawing lines between the points.