Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM2: The new 3D engine in action - check the video
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
https://youtu.be/JlzUSud4xC4 option explicit option default none mode 2,16 dim float phi=(1+sqr(5))/2 ' data for location of verticies for verticesahedron of edge length 2 data 0,1,3*phi data 0,1,-3*phi data 0,-1,3*phi data 0,-1,-3*phi data 1,3*phi,0 data 1,-3*phi,0 data -1,3*phi,0 data -1,-3*phi,0 data 3*phi,0,1 data 3*phi,0,-1 data -3*phi,0,1 data -3*phi,0,-1 data 2,(1+2*phi),phi data 2,(1+2*phi),-phi data 2,-(1+2*phi),phi data 2,-(1+2*phi),-phi data -2,(1+2*phi),phi data -2,(1+2*phi),-phi data -2,-(1+2*phi),phi data -2,-(1+2*phi),-phi data (1+2*phi),phi,2 data (1+2*phi),phi,-2 data (1+2*phi),-phi,2 data (1+2*phi),-phi,-2 data -(1+2*phi),phi,2 data -(1+2*phi),phi,-2 data -(1+2*phi),-phi,2 data -(1+2*phi),-phi,-2 data phi,2,(1+2*phi) data phi,2,-(1+2*phi) data phi,-2,(1+2*phi) data phi,-2,-(1+2*phi) data -phi,2,(1+2*phi) data -phi,2,-(1+2*phi) data -phi,-2,(1+2*phi) data -phi,-2,-(1+2*phi) data 1,(2+phi),2*phi data 1,(2+phi),-2*phi data 1,-(2+phi),2*phi data 1,-(2+phi),-2*phi data -1,(2+phi),2*phi data -1,(2+phi),-2*phi data -1,-(2+phi),2*phi data -1,-(2+phi),-2*phi data (2+phi),2*phi,1 data (2+phi),2*phi,-1 data (2+phi),-2*phi,1 data (2+phi),-2*phi,-1 data -(2+phi),2*phi,1 data -(2+phi),2*phi,-1 data -(2+phi),-2*phi,1 data -(2+phi),-2*phi,-1 data 2*phi,1,(2+phi) data 2*phi,1,-(2+phi) data 2*phi,-1,(2+phi) data 2*phi,-1,-(2+phi) data -2*phi,1,(2+phi) data -2*phi,1,-(2+phi) data -2*phi,-1,(2+phi) data -2*phi,-1,-(2+phi) ' 12 faces with 5 sides data 0,28,36,40,32 data 33,41,37,29,1 data 34,42,38,30,2 data 3,31,39,43,35 data 4,12,44,45,13 data 15,47,46,14,5 data 17,49,48,16,6 data 7,18,50,51,19 data 8,20,52,54,22 data 23,55,53,21,9 data 26,58,56,24,10 data 25,57,59,27,11 ' 20 faces with 6 sides data 32,56,58,34,2,0 data 0,2,30,54,52,28 data 29,53,55,31,3,1 data 1,3,35,59,57,33 data 13,37,41,17,6,4 data 4,6,16,40,36,12 data 5,7,19,43,39,15 'data 14,38,42,18,7,5 data 22,46,47,23,9,8 data 8,9,21,45,44,20 data 10,11,27,51,50,26 data 24,48,49,25,11,10 data 36,28,52,20,44,12 data 13,45,21,53,29,37 data 14,46,22,54,30,38 data 39,31,55,23,47,15 data 16,48,24,56,32,40 data 41,33,57,25,49,17 data 42,34,58,26,50,18 data 19,51,27,59,35,43 ' dim float q1(4) dim integer i, j, nf=31, nv=60, camera=1 dim float vertices(2,59) ' read in the coordinates of the verticies and scale for j=0 to 59 for i=0 to 2 read vertices(i,j) vertices(i,j)=vertices(i,j)*50 next i next j 'math scale vertices(),50,vertices() ' dim integer faces(173) for i=0 to 173 read faces(i) next i dim integer fc(30)= (5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6) dim integer colours(2)=(rgb(red),rgb(white),rgb(black)) dim integer edge(30)=(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2) dim integer fill(30)=(0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) math q_create rad(2),1,0.5,0.25,q1() draw3d create 1, nv,nf, camera, vertices(), fc(), faces(), colours(), edge(), fill() draw3d camera 1,800,mm.hres\2,mm.vres\2 'draw3d diagnose 1,mm.hres\2,mm.vres\2,1000 page write 1 draw3d show 1,mm.hres\2,mm.vres\2,1000,1 do draw3d rotate q1(),1 draw3d show 1,mm.hres\2,mm.vres\2,1000,1 draw3d reset 1 page copy 1 to 0,b loop |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1421 |
Oh, no! I hope you can find your missing pentagon! :D That's pretty impressive! Micromites and Maximites! - Beginning Maximite |
||||
JoOngle Regular Member Joined: 25/07/2020 Location: SwedenPosts: 82 |
Mind Blown! Anyone willing to make a Blender or .stl /.blend /.obj importer for it? :D I'm pretty good at 3D modelling, but I pretty much suck at math. |
||||
mkopack73 Senior Member Joined: 03/07/2020 Location: United StatesPosts: 261 |
Yeah would love to see some sort of standard 3D model file format for the CMM2, (or a reader that can take in a standard modern 3D file) and a library for reading it in... |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 444 |
JoOnlge, could you share here some files with a low poly model and a screenshot of the rendered polygon? (ply, obj, ...) |
||||
jirsoft Guru Joined: 18/09/2020 Location: Czech RepublicPosts: 532 |
I think at least standard PLY format could be used as first usable file type for 3D on CMM2: PLY format Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), Â CMM2.fun |
||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 430 |
What kid of PC apps are available to work with this format. It would be good to be able to design objects on a PC. EDIT: I did some searching and Blender and other can use the format. I have it on my portable apps install so I will play with that. Edited 2020-12-03 23:50 by mclout999 |
||||
JoOngle Regular Member Joined: 25/07/2020 Location: SwedenPosts: 82 |
@LeoNicolas. Yes of course. I made a quick 1-hour 3D character (all I had time for, sorry for the crudity of the model). But it's free, for all to download, experiment, test, make a game with, alter, build on, tear apart - as you wish. CMM2 Low Poly Model And if that link didn't work, here's another one: Find it here Edited 2020-12-04 03:18 by JoOngle |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
JoOngle Can you generate either the phy or stl in ascii format so I can see if the 3D engine will handle the model Thanks |
||||
JoOngle Regular Member Joined: 25/07/2020 Location: SwedenPosts: 82 |
@Matherp Yes - Compressed package updated with PLY as ASCII, with and without Normals(faces). Low-Poly-Free-TestCharacter |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
IT WORKS 362 Vertices and 361 faces Render time 10mSec! https://youtu.be/jYdevBvl73k Needed a mod to the firmware to overcome a limitation of 256 vertices and faces so V5.06.00b14 posted: http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip The model itself had a duff face so I've also included a new command in the firmware DRAW3D SET FLAGS n, flag, startface0, numberoffaces0 [, startface1, numberoffaces1 [,....]] This allows you to control the way a face is displayed. flag is a bitmap and has values as follows bit-0 ' don't display the face if set bit-1 ' display the face in red allowing you to visualise which each face is bit-2 ' reverse the normal vector I used the flags setting faces red to do a repeated binary chop of the faces until I determined the bad definition was face 132. The model has lots of faces with the surface normal the wrong way round so rather than trying to correct them all I've just used the option on the SHOW command to base the render solely on Painter's algorithm Code for the demo OPTION EXPLICIT OPTION DEFAULT NONE DATA 362 DATA 361 DATA -0.379360,0.389173,0.004961 DATA -0.379360,0.233113,0.004961 DATA -0.188428,0.123262,0.004961 DATA -0.188428,0.531739,0.004961 DATA -0.072191,0.222310,0.004973 DATA -0.047370,0.389173,0.004961 DATA -0.344274,0.007309,0.004961 DATA -0.188428,-0.092776,0.004961 DATA -0.047370,-0.092776,0.004961 DATA -0.300213,0.268194,0.167819 DATA -0.300213,0.356920,0.167819 DATA -0.344802,0.350181,0.315249 DATA -0.344802,0.225429,0.298482 DATA -0.191660,0.437974,0.167819 DATA -0.225357,0.411155,0.330566 DATA -0.191660,0.205740,0.167819 DATA -0.188428,-0.092776,0.073241 DATA -0.344274,0.007309,0.073241 DATA -0.122131,0.260776,0.167819 DATA -0.047370,-0.092776,0.073241 DATA -0.096576,0.356920,0.167819 DATA -0.357694,0.160042,0.598374 DATA -0.357694,0.334641,0.598374 DATA -0.304555,0.326214,0.827897 DATA -0.304555,0.170154,0.827897 DATA -0.060513,0.334641,0.455617 DATA -0.116905,0.145445,0.482640 DATA -0.096581,0.157107,0.621006 DATA -0.040722,0.356989,0.613865 DATA -0.225357,0.137617,0.286680 DATA -0.147194,0.215000,0.297080 DATA -0.110940,0.350181,0.315249 DATA -0.187957,0.113257,0.768829 DATA -0.315788,0.170154,0.901688 DATA -0.319766,0.167037,1.018321 DATA -0.255152,0.057362,0.975206 DATA -0.110650,0.090740,0.713959 DATA -0.137707,-0.011474,0.912633 DATA -0.194088,0.426330,0.503889 DATA -0.210049,0.446231,0.697688 DATA -0.195400,0.075364,0.526995 DATA -0.212395,0.128631,0.700298 DATA -0.075786,-0.044187,1.917807 DATA -0.002957,-0.081509,1.902842 DATA -0.002957,-0.108377,1.870530 DATA -0.066120,-0.099602,1.835642 DATA -0.318865,0.264565,1.010304 DATA -0.297236,0.290714,1.129285 DATA -0.288821,0.194878,1.144383 DATA -0.002957,-0.034833,0.898962 DATA -0.117945,0.023649,1.120933 DATA -0.002957,-0.014532,1.123231 DATA -0.315788,0.326214,0.901688 DATA -0.244262,0.476706,0.828632 DATA -0.147566,0.493777,0.787052 DATA -0.140880,0.504056,0.905703 DATA -0.262255,0.439912,0.980968 DATA -0.194575,0.305538,1.626750 DATA -0.087488,0.424681,1.653096 DATA -0.149058,0.476287,1.769081 DATA -0.327468,0.283027,1.744901 DATA -0.008203,0.375321,0.696224 DATA -0.068663,0.456001,0.797412 DATA -0.002957,0.083247,0.658685 DATA -0.002957,0.157451,0.597732 DATA -0.234039,0.371484,1.102735 DATA -0.111811,0.406216,1.069015 DATA -0.127071,0.442219,1.241262 DATA -0.217422,0.389940,1.287812 DATA -0.291448,0.342279,1.267611 DATA -0.252099,0.231323,1.285561 DATA -0.002957,0.405644,1.045036 DATA -0.002957,0.431072,1.238051 DATA 0.006364,0.463636,0.852790 DATA -0.224214,0.099127,1.071018 DATA -0.114606,0.507336,1.439379 DATA -0.205350,0.487452,1.455957 DATA -0.345402,0.482801,1.380065 DATA -0.334866,0.376492,1.291468 DATA -0.002957,0.488894,1.415226 DATA -0.104362,0.117189,1.256332 DATA -0.002957,0.103303,1.261941 DATA -0.063222,0.195233,1.576923 DATA -0.150337,0.248939,1.554561 DATA -0.177429,0.214422,1.617020 DATA -0.073851,0.151092,1.608612 DATA -0.186886,0.138747,1.258185 DATA -0.002957,0.140862,1.607076 DATA -0.202958,-0.074643,1.658773 DATA -0.119020,-0.072714,1.591007 DATA -0.074692,0.428356,1.571604 DATA -0.164757,0.397091,1.547789 DATA -0.098648,0.114806,1.475875 DATA -0.181202,0.211915,1.463738 DATA -0.398079,0.487595,1.479926 DATA -0.002957,0.103968,1.456772 DATA -0.002957,0.432364,1.572940 DATA -0.002957,0.429364,1.653985 DATA -0.271612,0.289241,1.482062 DATA -0.408993,0.377602,1.510960 DATA -0.602881,0.384554,1.487668 DATA -0.602646,0.495072,1.436344 DATA -0.596949,0.487155,1.329264 DATA -0.323371,0.384449,1.525717 DATA -0.393181,0.288377,1.479032 DATA -0.339974,0.264333,1.375487 DATA -0.603892,0.294344,1.442583 DATA -0.900347,0.334644,1.437974 DATA -0.905187,0.404108,1.459037 DATA -0.604835,0.267477,1.326850 DATA -0.900723,0.313956,1.383904 DATA -0.600755,0.377663,1.285929 DATA -0.904339,0.398802,1.347189 DATA -0.897576,0.483113,1.385031 DATA -1.004832,0.514249,1.383402 DATA -1.011595,0.415597,1.345559 DATA -0.899849,0.489209,1.435059 DATA -1.012443,0.420903,1.457407 DATA -1.007105,0.520345,1.433429 DATA -1.007979,0.315613,1.382274 DATA -1.182184,0.394566,1.373525 DATA -1.176931,0.305318,1.393395 DATA -1.007603,0.336302,1.436344 DATA -1.220113,0.353794,1.427750 DATA -1.242188,0.422756,1.444072 DATA -0.947814,0.243802,1.387684 DATA -0.901795,0.292021,1.388675 DATA -0.901419,0.293682,1.446544 DATA -0.947437,0.245463,1.445553 DATA -1.040362,0.200814,1.448129 DATA -1.050409,0.276098,1.449535 DATA -1.202093,0.506682,1.395307 DATA -1.229064,0.497859,1.423367 DATA -1.050680,0.261165,1.410507 DATA -1.040633,0.199615,1.406360 DATA -0.002957,0.186534,1.578548 DATA -0.232839,0.365737,1.555737 DATA -0.245977,0.293756,1.549688 DATA -0.225090,0.518196,1.903408 DATA -0.488844,0.345532,1.866283 DATA -0.002957,0.557568,1.751750 DATA -0.002957,0.638326,1.875633 DATA -0.288527,0.096293,1.684966 DATA -0.199190,0.003402,1.875237 DATA -0.159336,-0.018665,1.919760 DATA -0.449903,0.083576,1.812538 DATA -0.361025,0.302378,1.999151 DATA -0.395589,0.033628,1.954215 DATA -0.226882,-0.016186,2.043459 DATA -0.091346,-0.040276,2.092963 DATA -0.266352,-0.105650,1.773366 DATA -0.120014,-0.183914,1.709304 DATA -0.002957,-0.090258,1.570264 DATA -0.368176,0.016043,2.114511 DATA -0.335528,-0.066181,2.086433 DATA -0.182615,0.523903,2.063726 DATA -0.317187,0.374948,2.225507 DATA -0.364419,0.329891,2.210448 DATA -0.002957,0.668784,2.096423 DATA -0.002957,0.587981,2.294384 DATA -0.002957,0.465092,2.384136 DATA -0.266393,0.288139,2.349916 DATA -0.313082,0.244150,2.342466 DATA -0.304908,0.014978,2.259953 DATA -0.002957,-0.210245,1.675899 DATA -0.002957,-0.145271,2.191161 DATA -0.152290,-0.122570,2.197897 DATA -0.085615,0.029052,2.337431 DATA -0.002957,0.009110,2.332926 DATA -0.201430,0.102329,2.361432 DATA -0.441877,0.370919,2.242938 DATA -0.393230,0.435021,2.261176 DATA -0.431725,0.466106,2.395273 DATA -0.500593,0.371474,2.361792 DATA -0.002957,-0.161782,2.090673 DATA -0.221996,0.183704,2.386207 DATA -0.091185,0.263378,2.413061 DATA -0.002957,0.291527,2.422412 DATA -0.417446,0.397283,2.459735 DATA -0.478491,0.336459,2.436249 DATA -0.323227,0.320639,2.460103 DATA -0.381775,0.272113,2.433417 DATA -0.002957,-0.198377,1.879622 DATA -0.094375,-0.210841,1.846853 DATA -0.002957,-0.277519,1.747358 DATA -0.105406,-0.254375,1.781103 DATA 0.373447,0.389173,0.004961 DATA 0.182515,0.531739,0.004961 DATA 0.182515,0.123262,0.004961 DATA 0.373447,0.233113,0.004961 DATA 0.041456,0.389173,0.004961 DATA 0.066277,0.222310,0.004973 DATA 0.182515,-0.092776,0.004961 DATA 0.338361,0.007309,0.004961 DATA 0.041456,-0.092776,0.004961 DATA 0.294299,0.268194,0.167819 DATA 0.338888,0.225429,0.298482 DATA 0.338888,0.350181,0.315249 DATA 0.294299,0.356920,0.167819 DATA 0.219444,0.411155,0.330566 DATA 0.185747,0.437974,0.167819 DATA 0.338361,0.007309,0.073241 DATA 0.182515,-0.092776,0.073241 DATA 0.185747,0.205740,0.167819 DATA 0.041456,-0.092776,0.073241 DATA 0.116217,0.260776,0.167819 DATA 0.090662,0.356920,0.167819 DATA 0.351781,0.160042,0.598374 DATA 0.298641,0.170154,0.827897 DATA 0.298641,0.326214,0.827897 DATA 0.351781,0.334641,0.598374 DATA 0.054600,0.334641,0.455617 DATA 0.034808,0.356989,0.613865 DATA 0.090667,0.157107,0.621006 DATA 0.110991,0.145445,0.482640 DATA 0.219444,0.137617,0.286680 DATA 0.105027,0.350181,0.315249 DATA 0.141281,0.215000,0.297080 DATA 0.182043,0.113257,0.768829 DATA 0.249238,0.057362,0.975206 DATA 0.313853,0.167037,1.018321 DATA 0.309874,0.170154,0.901688 DATA 0.104736,0.090740,0.713959 DATA 0.131793,-0.011474,0.912633 DATA 0.188175,0.426330,0.503889 DATA 0.204136,0.446231,0.697688 DATA 0.206481,0.128631,0.700298 DATA 0.189487,0.075364,0.526995 DATA 0.069872,-0.044187,1.917807 DATA 0.060206,-0.099602,1.835642 DATA 0.282907,0.194878,1.144383 DATA 0.291323,0.290714,1.129285 DATA 0.312951,0.264565,1.010304 DATA 0.112032,0.023649,1.120933 DATA 0.309874,0.326214,0.901688 DATA 0.238348,0.476706,0.828632 DATA 0.256341,0.439912,0.980968 DATA 0.147392,0.496192,0.920286 DATA 0.141652,0.493777,0.787052 DATA 0.188661,0.305538,1.626750 DATA 0.321555,0.283027,1.744901 DATA 0.143145,0.476287,1.769081 DATA 0.081574,0.424681,1.653096 DATA 0.062749,0.456001,0.797412 DATA 0.228126,0.371484,1.102735 DATA 0.211509,0.389940,1.287812 DATA 0.121157,0.442219,1.241262 DATA 0.105897,0.406216,1.069015 DATA 0.246185,0.231323,1.285561 DATA 0.285534,0.342279,1.267611 DATA 0.218301,0.099127,1.071018 DATA 0.199437,0.487452,1.455957 DATA 0.108693,0.507336,1.439379 DATA 0.328952,0.376492,1.291468 DATA 0.339488,0.482801,1.380065 DATA 0.098448,0.117189,1.256332 DATA 0.057309,0.195233,1.576923 DATA 0.067937,0.151092,1.608612 DATA 0.171516,0.214422,1.617020 DATA 0.144423,0.248939,1.554561 DATA 0.180973,0.138747,1.258185 DATA 0.113106,-0.072714,1.591007 DATA 0.197045,-0.074643,1.658773 DATA 0.158843,0.397091,1.547789 DATA 0.068778,0.428356,1.571604 DATA 0.092735,0.114806,1.475875 DATA 0.175288,0.211915,1.463738 DATA 0.392166,0.487595,1.479926 DATA 0.265699,0.289241,1.482062 DATA 0.596732,0.495072,1.436344 DATA 0.596967,0.384554,1.487668 DATA 0.403080,0.377602,1.510960 DATA 0.591036,0.487155,1.329264 DATA 0.317458,0.384449,1.525717 DATA 0.387267,0.288377,1.479032 DATA 0.334060,0.264333,1.375487 DATA 0.899274,0.404108,1.459037 DATA 0.894433,0.334644,1.437974 DATA 0.597979,0.294344,1.442583 DATA 0.894809,0.313956,1.383904 DATA 0.598921,0.267477,1.326850 DATA 0.594842,0.377663,1.285929 DATA 0.898426,0.398802,1.347189 DATA 1.005681,0.415597,1.345559 DATA 0.998918,0.514249,1.383402 DATA 0.891663,0.483113,1.385031 DATA 0.893936,0.489209,1.435059 DATA 1.001192,0.520345,1.433429 DATA 1.006530,0.420903,1.457407 DATA 1.002065,0.315613,1.382274 DATA 1.171017,0.305318,1.393395 DATA 1.176270,0.394566,1.373525 DATA 1.236274,0.422756,1.444072 DATA 1.214199,0.353794,1.427750 DATA 1.001689,0.336302,1.436344 DATA 0.895881,0.292021,1.388675 DATA 0.941900,0.243802,1.387684 DATA 0.895505,0.293682,1.446544 DATA 0.941524,0.245463,1.445553 DATA 1.044495,0.276098,1.449535 DATA 1.034448,0.200814,1.448129 DATA 1.223150,0.497859,1.423367 DATA 1.196179,0.506682,1.395307 DATA 1.044767,0.261165,1.410507 DATA 1.034719,0.199615,1.406360 DATA 0.226925,0.365737,1.555737 DATA 0.240064,0.293756,1.549688 DATA 0.482931,0.345532,1.866283 DATA 0.219177,0.518196,1.903408 DATA 0.282613,0.096293,1.684966 DATA 0.153423,-0.018665,1.919760 DATA 0.193276,0.003402,1.875237 DATA 0.443990,0.083576,1.812538 DATA 0.389676,0.033628,1.954215 DATA 0.355111,0.302378,1.999151 DATA 0.085432,-0.040276,2.092963 DATA 0.220968,-0.016186,2.043459 DATA 0.260438,-0.105650,1.773366 DATA 0.114100,-0.183914,1.709304 DATA 0.329614,-0.066181,2.086433 DATA 0.362263,0.016043,2.114511 DATA 0.358506,0.329891,2.210448 DATA 0.311273,0.374948,2.225507 DATA 0.176701,0.523903,2.063726 DATA 0.260480,0.288139,2.349916 DATA 0.298994,0.014978,2.259953 DATA 0.307168,0.244150,2.342466 DATA 0.079702,0.029052,2.337431 DATA 0.146377,-0.122570,2.197897 DATA 0.195517,0.102329,2.361432 DATA 0.435964,0.370919,2.242938 DATA 0.494679,0.371474,2.361792 DATA 0.425812,0.466106,2.395273 DATA 0.387316,0.435021,2.261176 DATA 0.216082,0.183704,2.386207 DATA 0.085271,0.263378,2.413061 DATA 0.472578,0.336459,2.436249 DATA 0.411532,0.397283,2.459735 DATA 0.317313,0.320639,2.460103 DATA 0.375861,0.272113,2.433417 DATA 0.088461,-0.210841,1.846853 DATA 0.099493,-0.254375,1.781103 DATA -0.022537,0.559884,0.832170 DATA 0.069308,0.553783,0.760912 DATA -0.031686,0.527362,0.674901 DATA 0.199427,0.723933,0.560435 DATA 0.006664,0.668892,0.439200 DATA -0.137371,0.551012,0.730322 DATA 0.009815,0.881898,0.761479 DATA 0.052449,1.069262,0.486229 DATA 0.162836,0.985650,0.364496 DATA -0.195960,0.789529,0.590455 DATA 0.051269,0.956444,0.292985 DATA 0.105354,1.139440,0.306910 DATA 0.061822,1.134228,0.277364 DATA -0.063763,1.006549,0.351095 DATA 0.016627,1.143001,0.305339 DATA 0.060584,1.222685,0.297914 DATA 0.043490,1.226004,0.308495 DATA 0.061933,1.153231,0.362449 DATA 0.077049,1.224657,0.309089 DATA 0.060626,1.229873,0.330095 DATA 87,152,261 DATA 0,1,2,3 DATA 3,2,4,5 DATA 1,6,7,2 DATA 2,7,8,4 DATA 9,10,11,12 DATA 10,13,14,11 DATA 9,15,16,17 DATA 15,18,19,16 DATA 5,4,18,20 DATA 6,1,9,17 DATA 7,6,17,16 DATA 3,5,20,13 DATA 0,3,13,10 DATA 4,8,19,18 DATA 8,7,16,19 DATA 1,0,10,9 DATA 21,22,23,24 DATA 25,26,27,28 DATA 15,9,12,29 DATA 20,18,30,31 DATA 18,15,29,30 DATA 13,20,31,14 DATA 32,33,34,35 DATA 36,32,35,37 DATA 38,25,28,39 DATA 22,38,39,23 DATA 26,40,41,27 DATA 40,21,24,41 DATA 42,43,44,45 DATA 34,46,47,48 DATA 49,37,50,51 DATA 33,52,46,34 DATA 53,54,55,56 DATA 52,53,56,46 DATA 57,58,59,60 DATA 54,28,61,62 DATA 36,37,49,63 DATA 28,27,64,61 DATA 65,66,67,68 DATA 48,47,69,70 DATA 66,71,72,67 DATA 56,55,66,65 DATA 46,56,65,47 DATA 55,73,71,66 DATA 37,35,74,50 DATA 35,34,48,74 DATA 68,67,75,76 DATA 69,68,77,78 DATA 67,72,79,75 DATA 47,65,68,69 DATA 51,50,80,81 DATA 82,83,84,85 DATA 50,74,86,80 DATA 74,48,70,86 DATA 27,36,63,64 DATA 55,54,62,73 DATA 87,85,88,89 DATA 23,39,53,52 DATA 39,28,54,53 DATA 24,23,52,33 DATA 27,41,32,36 DATA 41,24,33,32 DATA 76,75,90,91 DATA 92,93,83,82 DATA 68,76,94,77 DATA 81,80,92,95 DATA 90,96,97,58 DATA 80,86,93,92 DATA 86,70,98,93 DATA 29,12,21,40 DATA 30,29,40,26 DATA 11,14,38,22 DATA 14,31,25,38 DATA 31,30,26,25 DATA 12,11,22,21 DATA 94,99,100,101 DATA 77,94,101,102 DATA 103,98,104,99 DATA 98,70,105,104 DATA 76,103,99,94 DATA 70,69,78,105 DATA 100,106,107,108 DATA 106,109,110,107 DATA 78,77,102,111 DATA 104,105,109,106 DATA 99,104,106,100 DATA 105,78,111,109 DATA 112,113,114,115 DATA 116,108,117,118 DATA 109,111,112,110 DATA 102,101,116,113 DATA 101,100,108,116 DATA 111,102,113,112 DATA 119,115,120,121 DATA 117,122,123,124 DATA 110,119,125,126 DATA 108,107,122,117 DATA 110,112,115,119 DATA 113,116,118,114 DATA 127,126,125,128 DATA 107,110,126,127 DATA 122,107,127,128 DATA 122,128,129,130 DATA 121,120,124,123 DATA 120,131,132,124 DATA 114,118,132,131 DATA 118,117,124,132 DATA 115,114,131,120 DATA 122,119,121,123 DATA 133,130,129,134 DATA 128,125,134,129 DATA 119,122,130,133 DATA 125,119,133,134 DATA 95,92,82,135 DATA 136,91,83,137 DATA 91,90,58,57 DATA 135,82,85,87 DATA 60,59,138,139 DATA 59,140,141,138 DATA 83,91,57,84 DATA 103,76,91,136 DATA 75,79,96,90 DATA 98,103,136,137 DATA 93,98,137,83 DATA 85,84,142,88 DATA 45,143,144,42 DATA 58,97,140,59 DATA 84,57,60,142 DATA 145,139,146,147 DATA 42,144,148,149 DATA 88,142,145,150 DATA 89,88,150,151 DATA 3,87,89,152 DATA 142,60,139,145 DATA 143,147,153,154 DATA 146,155,156,157 DATA 138,141,158,155 DATA 139,138,155,146 DATA 150,145,147,143 DATA 151,150,143,45 DATA 156,159,160,161 DATA 153,157,162,163 DATA 143,154,148,144 DATA 164,152,89,151 DATA 147,146,157,153 DATA 155,158,159,156 DATA 165,166,167,168 DATA 166,163,169,167 DATA 170,171,172,173 DATA 154,153,163,166 DATA 149,166,165,174 DATA 175,176,167,169 DATA 167,176,177,168 DATA 163,162,175,169 DATA 161,160,177,176 DATA 162,161,176,175 DATA 149,148,154,166 DATA 173,172,178,179 DATA 171,180,178,172 DATA 180,181,179,178 DATA 181,170,173,179 DATA 162,157,170,181 DATA 161,162,181,180 DATA 156,161,180,171 DATA 157,156,171,170 DATA 45,44,182,183 DATA 182,184,185,183 DATA 43,42,149,174 DATA 151,45,183,185 DATA 164,151,185,184 DATA 186,187,188,189 DATA 187,190,191,188 DATA 189,188,192,193 DATA 188,191,194,192 DATA 195,196,197,198 DATA 198,197,199,200 DATA 195,201,202,203 DATA 203,202,204,205 DATA 190,206,205,191 DATA 193,201,195,189 DATA 192,202,201,193 DATA 187,200,206,190 DATA 186,198,200,187 DATA 191,205,204,194 DATA 194,204,202,192 DATA 189,195,198,186 DATA 207,208,209,210 DATA 211,212,213,214 DATA 203,215,196,195 DATA 206,216,217,205 DATA 205,217,215,203 DATA 200,199,216,206 DATA 218,219,220,221 DATA 222,223,219,218 DATA 224,225,212,211 DATA 210,209,225,224 DATA 214,213,226,227 DATA 227,226,208,207 DATA 228,229,44,43 DATA 220,230,231,232 DATA 49,51,233,223 DATA 221,220,232,234 DATA 235,236,237,238 DATA 234,232,236,235 DATA 239,240,241,242 DATA 238,243,61,212 DATA 222,63,49,223 DATA 212,61,64,213 DATA 244,245,246,247 DATA 230,248,249,231 DATA 247,246,72,71 DATA 236,244,247,237 DATA 232,231,244,236 DATA 237,247,71,73 DATA 223,233,250,219 DATA 219,250,230,220 DATA 245,251,252,246 DATA 249,253,254,245 DATA 246,252,79,72 DATA 231,249,245,244 DATA 51,81,255,233 DATA 256,257,258,259 DATA 233,255,260,250 DATA 250,260,248,230 DATA 213,64,63,222 DATA 237,73,243,238 DATA 87,261,262,257 DATA 209,234,235,225 DATA 225,235,238,212 DATA 208,221,234,209 DATA 213,222,218,226 DATA 226,218,221,208 DATA 251,263,264,252 DATA 265,256,259,266 DATA 245,254,267,251 DATA 81,95,265,255 DATA 264,242,97,96 DATA 255,265,266,260 DATA 260,266,268,248 DATA 215,227,207,196 DATA 217,214,227,215 DATA 197,210,224,199 DATA 199,224,211,216 DATA 216,211,214,217 DATA 196,207,210,197 DATA 267,269,270,271 DATA 254,272,269,267 DATA 273,271,274,268 DATA 268,274,275,248 DATA 251,267,271,273 DATA 248,275,253,249 DATA 270,276,277,278 DATA 278,277,279,280 DATA 253,281,272,254 DATA 274,278,280,275 DATA 271,270,278,274 DATA 275,280,281,253 DATA 282,283,284,285 DATA 286,287,288,276 DATA 280,279,282,281 DATA 272,285,286,269 DATA 269,286,276,270 DATA 281,282,285,272 DATA 289,290,291,283 DATA 288,292,293,294 DATA 279,295,296,289 DATA 276,288,294,277 DATA 279,289,283,282 DATA 285,284,287,286 DATA 297,298,296,295 DATA 277,297,295,279 DATA 294,298,297,277 DATA 294,299,300,298 DATA 290,293,292,291 DATA 291,292,301,302 DATA 284,302,301,287 DATA 287,301,292,288 DATA 283,291,302,284 DATA 294,293,290,289 DATA 303,304,300,299 DATA 298,300,304,296 DATA 289,303,299,294 DATA 296,304,303,289 DATA 95,135,256,265 DATA 305,306,259,263 DATA 263,239,242,264 DATA 135,87,257,256 DATA 240,307,308,241 DATA 241,308,141,140 DATA 259,258,239,263 DATA 273,305,263,251 DATA 252,264,96,79 DATA 268,306,305,273 DATA 266,259,306,268 DATA 257,262,309,258 DATA 229,228,310,311 DATA 242,241,140,97 DATA 258,309,240,239 DATA 312,313,314,307 DATA 228,315,316,310 DATA 262,317,312,309 DATA 261,318,317,262 DATA 309,312,307,240 DATA 311,319,320,313 DATA 314,321,322,323 DATA 308,323,158,141 DATA 307,314,323,308 DATA 317,311,313,312 DATA 318,229,311,317 DATA 322,324,160,159 DATA 320,325,326,321 DATA 311,310,316,319 DATA 164,318,261,152 DATA 313,320,321,314 DATA 323,322,159,158 DATA 165,168,327,328 DATA 328,327,329,325 DATA 330,331,332,333 DATA 319,328,325,320 DATA 315,174,165,328 DATA 334,329,327,335 DATA 327,168,177,335 DATA 325,329,334,326 DATA 324,335,177,160 DATA 326,334,335,324 DATA 315,328,319,316 DATA 331,336,337,332 DATA 333,332,337,338 DATA 338,337,336,339 DATA 339,336,331,330 DATA 326,339,330,321 DATA 324,338,339,326 DATA 322,333,338,324 DATA 321,330,333,322 DATA 229,340,182,44 DATA 182,340,341,184 DATA 43,174,315,228 DATA 318,341,340,229 DATA 164,184,341,318 DATA 243,73,342,343 DATA 344,343,345,346 DATA 61,243,343,344 DATA 62,61,344,347 DATA 73,62,347,342 DATA 345,348,349,350 DATA 347,344,346,351 DATA 343,342,348,345 DATA 342,347,351,348 DATA 352,350,353,354 DATA 348,351,355,349 DATA 346,345,350,352 DATA 351,346,352,355 DATA 356,354,357,358 DATA 355,352,354,356 DATA 350,349,359,353 DATA 349,355,356,359 DATA 357,360,361,358 DATA 353,359,361,360 DATA 359,356,358,361 DATA 354,353,360,357 ' DIM INTEGER i, nv, nf, camera=1, n=1, face_x_vert read nv, nf DIM FLOAT vertices(2,nv-1), q(4), yaw=rad(1) DIM INTEGER facecount(nf-1), edge(nf-1), fill(nf-1) dim integer colours(1)=(rgb(white),rgb(blue)) for i=0 to nv-1 read vertices(0,i), vertices(1,i), vertices(2,i) next i math scale vertices(),200,vertices() for i=0 to nf-1 fill(i)=1 edge(i)=0 facecount(i)=4 next i facecount(0)=3 face_x_vert=math(sum facecount()) dim integer faces(face_x_vert-1) for i=0 to face_x_vert-1 read faces(i) next i page write 1 draw3d create n, nv, nf, camera, vertices(), facecount(), faces(), colours(), edge(), fill() math q_create rad(-90),1,0,0,q() draw3d rotate q(),n draw3d reset n draw3d camera camera, 500,,250 draw3d show 1,0,0,600 draw3d set flag 1,1,132,1 do math q_euler yaw,0,0,q() draw3d rotate q(),n print @(0,0)(deg(yaw) mod 360) draw3d show 1,0,0,600,1 page copy 1 to 0,b inc yaw,rad(1) loop Edited 2020-12-05 04:08 by matherp |
||||
JoOngle Regular Member Joined: 25/07/2020 Location: SwedenPosts: 82 |
That's simply awesome! It looks so smooth too. How do you think it would handle vertex animation? Let's say we made 8 poses (same character, but with 8 new vertex positions so to make a running loop)? And (perhaps dreaming here - but saving on animation), could it be possible for a routine to "interpolate" between 2-3 poses? For example move the vertices from POSE A - to POSE B. And set a number of motion steps between them so less memory and less vertice pose characters would be needed? In animation, we use extremes and in-betweens, the extremes are poses like "Legs far apart", "Legs-crosses" and lastly "Legs far appart, but mirrored", these are 3 extremes used for a walk animation. In-betweens are the missing movement frames between POS A- B - C, let's say it makes 2 interpolations or 3 inbetween each extreme pose. Thanks for your insane efforts. *Edit* Oh and yes, for the "duff faces", my bad - I used the "Mirror-modifier" in Blender, I guess when it Mirrors, it doesn't automatically take the mirrored part and unifies the faces to outside faces. I should have checked for that when I delivered the model. Edited 2020-12-05 04:38 by JoOngle |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
Check this one out 1335 vertices and 2452 faces rendered in 113mSec |
||||
JoOngle Regular Member Joined: 25/07/2020 Location: SwedenPosts: 82 |
I had some time on my hand since it's friday, so I have made some .ply poses available to you all, feel free to experiment (hopefully this time, the model is properly clean of double vertices and normals should be outside on all faces): Since the animation test was specifically made for CMM2 type of export/import animation, I had no way to test if it animates perfectly, so this is a trial and error. .Blend files and a fully rigged character is included, you're free to improve on it fix it, debug, add to it, use it in your games etc. GPL license all the way. Animation .ply test files |
||||
Paul_L Guru Joined: 03/03/2016 Location: United StatesPosts: 769 |
Very nice, only it needs a little more dihedral for stability. Just don't add too much or you'll get a Dutch Roll like all of the early B707-100 aircraft. Paul in NY |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
New video to check out: https://youtu.be/nWljj64qmgs This new capability uses the dot-product of the surface normal of each face with the vector to a notional lighting source to attenuate the colour. The code allows the MMBasic programmer to set an "ambient" level of light which will be there regardless. In the example this is set to a low level |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8573 |
One more video https://youtu.be/mEtwfwLlpaY 16-bit colour, 1335 vertices, 2452 faces and programmed lighting. The number top left shows the render time in milliseconds Edited 2020-12-06 20:14 by matherp |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 444 |
Peter This is an impressive example of what the new API can do. Amazing. I'm following the new features and examples but I'm not having time to play with them |
||||
Coresoap Newbie Joined: 27/11/2020 Location: GermanyPosts: 3 |
Hi, can anybody please post the routine to load the ply files to use them with the new commands. Thanks a lot. Best regards Mike |
||||
Print this page |