Cov txheej txheem:
Video: 3D Viewer: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Nyob zoo! Txhawm rau kom txaus siab rau kuv txoj kev nyiam ua haujlwm thiab vam tias yuav pab txaus siab rau koj, Kuv xav qhia koj li 3D Viewer uas kuv tau sau rau hauv javascript. Yog tias koj xav txuas ntxiv koj qhov kev nkag siab ntawm 3D kev ua si lossis txawm tias tsim koj tus kheej 3D game, qhov qauv 3D saib no zoo tshaj rau koj.
Kauj Ruam 1: Txoj Kev Xav
Txhawm rau nkag siab txoj kev xav ntawm tus saib 3D no, koj tuaj yeem yooj yim tshuaj xyuas txoj hauv kev uas koj saib koj ib puag ncig (nws pab kom muaj ib qho tseem ceeb ntawm lub teeb). Ceeb toom tias:
- Cov hom phiaj uas nyob deb dua ntawm koj coj ib feem me me ntawm koj lub zeem muag.
- Cov khoom uas nyob deb dua ntawm lub teeb pom kev tsaus xim.
- Raws li cov npoo dhau los ua qhov sib luag (tsawg dua ib puag ncig) rau lub teeb pom kev, lawv pom xim tsaus dua.
Kuv txiav txim siab los sawv cev rau lub zeem muag pom nrog ib pawg ntawm txoj kab los ntawm ib qho taw tes (zoo ib yam rau lub qhov muag). Zoo li lub pob ntsia hlau loj, cov kab yuav tsum tau sib nrug sib nrug kom ntseeg tau tias txhua feem ntawm lub zeem muag pom tau zoo ib yam. Hauv daim duab saum toj no, ceeb toom li cas cov kab uas los ntawm lub pob ntsia hlau loj zuj zus thaum lawv txav mus deb ntawm qhov nruab nrab ntawm lub pob. Qhov no pab pom qhov kev zov me nyuam ua qhov kev soj ntsuam 1 txij li qhov ntom ntom ntawm cov kab txo qis vim cov khoom txav mus deb ntawm qhov chaw nruab nrab.
Cov kab yog lub hauv paus tseem ceeb ntawm kev pom kev hauv qhov haujlwm, thiab lawv txhua tus tau teeb tsa rau pixel ntawm cov zaub. Thaum ib txoj kab hla ib qho khoom, nws cov pixel sib xws yog xim raws nws qhov deb ntawm lub teeb ci thiab nws lub kaum sab xis los ntawm lub teeb ci.
Kauj Ruam 2: Siv Txoj Kev Xav
Txhawm rau kom yooj yim rau txoj haujlwm, lub teeb pom kev zoo ib yam li qhov chaw nruab nrab (lub qhov muag: taw tes los ntawm qhov uas daim duab qhia chaw tau saib thiab qhov twg cov kab pib los ntawm). Zoo sib xws los tuav lub teeb nyob ib sab ntawm koj lub ntsej muag, qhov no tshem tawm cov duab ntxoov ntxoo thiab tso cai rau qhov ci ntawm txhua lub pixel kom suav tau yooj yim dua.
Qhov kev zov me nyuam tseem siv kev sib koom ua ke, nrog lub hauv paus ntsiab lus ntawm lub zeem muag ntawm keeb kwm. Qhov no ua rau cov kab tsim tau yooj yim (txhua qhov tshwj xeeb theta: kab rov tav thiab phi: lub kaum ntse ntse ntsug), thiab muab lub hauv paus ntawm kev suav. Kab nrog tib theta tau teeb tsa rau pixels hauv tib kab. Phis ntawm cov ces kaum sib luag nce thoob txhua kab ntawm pixels.
Txhawm rau ua kom yooj yim rau kev ua lej, daim duab qhia 3D tau tsim los ntawm cov dav hlau nrog qhov sib txawv sib txawv (sib xws x, y, lossis z), thaum lwm qhov ob qhov tsis sib xws uas tsis sib xws raug kaw nyob hauv ib thaj tsam, ua tiav cov ntsiab lus ntawm txhua lub dav hlau.
Txhawm rau saib ib puag ncig nrog nas, qhov kev zov me nyuam qhov sib npaug hauv kev sib hloov ntsug thiab kab rov tav thaum hloov pauv ntawm kheej kheej thiab xyz kev sib koom tes. Qhov no muaj qhov cuam tshuam ntawm preforming kev sib hloov ntawm "pob spike" txheej ntawm kab pom kev.
Kauj Ruam 3: Lej
Cov kab zauv hauv qab no pab kom txoj haujlwm txiav txim siab kab twg cuam tshuam txhua yam khoom thiab cov ntaub ntawv hais txog txhua qhov kev sib tshuam. Kuv tau txais cov kev sib npaug no los ntawm kev sib koom ua haujlwm kheej kheej yooj yim thiab 2D sib npaug sib npaug:
r = nrug, t = theta (kab rov tav), p = phi (ntsug lub kaum ntse ntse), A = kev sib hloov txog Y axis (kev sib hloov ntsug), B = kev sib hloov txog Z axis (kev hloov kab rov tav)
Kx = (sin (p)*cos (t)*cos (A)+cos (p)*sin (A))*cos (B) -sin (p)*sin (t)*sin (B)
Ky = (sin (p)*cos (t)*cos (A)+cos (p)*sin (A))*sin (B)+sin (p)*sin (t)*cos (B)
Kz = -sin (p)*cos (t)*sin (A)+cos (p)*cos (A)
x = r*Kx
y = r*Ky
z = r*Kz
r^2 = x^2+y^2+z^2
teeb pom kev zoo = Klight/r*(Kx lossis Ky lossis Kz)
p = arccos ((x*sin (A)*cos (B)+y*sin (A)*sin (B)+z*cos (A))/r)
t = arccos ((x*cos (B)+y*sin (B) -p*sin (A)*cos (p))/(r*cos (A)*sin (p)))
Kauj Ruam 4: Txoj Haujlwm
Kuv vam tias tsab ntawv pom 3D no pab koj nkag siab txog kev ua haujlwm ntawm 3D qhov tseeb tiag. Nrog qee qhov ua kom zoo dua qub thiab coding, tus saib no yeej muaj peev xwm muab tso rau siv hauv 3D kev txhim kho game.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
ESP32 COVID19 STATUS VIEWER: 4 Kauj Ruam
ESP32 COVID19 STATUS VIEWER: Txoj haujlwm no tsuas yog tau txais cov xwm txheej ntawm COCID19 hauv json hom thiab tso tawm rau hauv OLED
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Arduino Baby Monitor With Java Viewer: 8 Kauj Ruam (nrog Duab)
Arduino Baby Monitor With Java Viewer: Tsim kom muaj Arduino-based multi-sensor unit los saib xyuas cov xwm txheej hauv chav. Chav tsev no tuaj yeem paub qhov av noo, qhov kub thiab txias, suab, thiab suab. Txuas yog java raws tus saib uas tau txais cov ntaub ntawv xov xwm los ntawm arduino