1 / 13

RapidRaycast

Trimesteroverschrijdend Project Bjorn Schobben Domien Nowicki. RapidRaycast. Overzicht. Wat Is Raycasting? Project Doel Project Structuur Project Algoritmen Demo Vragen?. Wat Is Raycasting?. Snelle techniek om 3D beeld te genereren uit 2D map (plattegrond) Sneller dan ray tracing

holli
Download Presentation

RapidRaycast

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Trimesteroverschrijdend Project Bjorn Schobben Domien Nowicki RapidRaycast

  2. Overzicht Wat Is Raycasting? Project Doel Project Structuur Project Algoritmen Demo Vragen?

  3. Wat Is Raycasting? Snelle techniek om 3D beeld te genereren uit 2D map (plattegrond) Sneller dan raytracing Niet alle rays berekenen, slechts 1 per vertikale streep van scherm Pseudo-3D beeld Niet perspectief correct Geen echte lichtinval Altijd gebruik van simpele objecten (bv. muren)

  4. Wat Is Raycasting? Bekend voorbeeld: Wolfenstein 3D

  5. Project Doel Raycast engine bouwen Met modeler Eigen map kunnen maken

  6. Project Structuur Texturelijst Map 2D array van cellen Ray Zoeken van dichtsbijzijnde muren Slice Renderen van een vertikale scherm-streep Raycaster Heel het beeld renderen, via slice Keuze tussen vectoren en hoeken Met vectoren: makkelijker en nauwkeuriger

  7. Project Algoritmen: Raycasting Position vector Positie van het oog Direction vector (eenheids vector) Richting waar het oog naar kijkt Camera plane vector (eenheids vector) Richting van het cameravlak

  8. Project Algoritmen: Raycasting Voor elke vertikale streep,“cast” een ray DW = afstand totdichtsbijzijnde muur DC = afstand tot camera = 1 (eenheidsvector) WH = eigenlijke muur hoogte PH = geprojecteerde muur hoogte = ?

  9. Project Algoritmen: Raycasting PH/DC = WH/DW (driehoeksverhouding) PH = WH / DW * DC

  10. Project Algoritmen: Raycasting PH = Wall slice hoogte SH = Scherm hoogte Wall slice is gecentreerd over het scherm Positie van wall slice = (SH/2) – (PH/2) Teken nu wall slice voor elke vertikale streep, klaar!

  11. Project Algoritmen: Ray DDA algoritme: Iteratief elke cel, die ray snijdt, controleren op aanwezigheid muur: Bereken afstand tot volgende horizontale en verticale intersectie Als de horizontale korter: beschouw bovenbuur Als verticale korter: Beschouw rechterbuur Analoog voor rays in andere richtingen Afstand tot muur en intersectiepunt met muur onthouden

  12. Demo

  13. Vragen?

More Related