Skip to content

JuliaGeometry/RayCaster.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RayCaster.jl

Build Status

Performant ray intersection engine for CPU and GPU.

Getting Started

To get started with RayCaster.jl, first add the package to your Julia environment:

using Pkg
Pkg.add(url="https://github.com/JuliaGeometry/RayCaster.jl")

Then you can create a basic ray intersection scene:

using RayCaster, GeometryBasics, LinearAlgebra

# Create some simple spheres
function LowSphere(radius, contact=Point3f(0); ntriangles=10)
    return Tesselation(Sphere(contact .+ Point3f(0, 0, radius), radius), ntriangles)
end

# Build a scene with multiple objects
s1 = LowSphere(0.5f0, Point3f(-0.5, 0.0, 0); ntriangles=10)
s2 = LowSphere(0.3f0, Point3f(1, 0.5, 0); ntriangles=10)

# Create BVH acceleration structure
bvh = RayCaster.BVHAccel([s1, s2])

# Perform ray-scene intersections
viewdir = normalize(Vec3f(0, 0, -1))
hitpoints, centroid = RayCaster.get_centroid(bvh, viewdir)

Documentation

For detailed examples and API documentation, see the full documentation.

About

Performant ray tracing on CPU and GPU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages