Skip to content
Discussion options

You must be logged in to vote

Hi @itsghaniz

This is pretty awkward to do.

Here's how I'd go about it, it relies on the fact that we have unique ShapePtr identifiers for each shape object:

import mitsuba as mi
import drjit as dr

mi.set_variant('cuda_ad_rgb')

# Find the `ShapePtr` of the object you're interested in
scene = mi.load_dict(mi.cornell_box())
large_box_ptr = None
for shape in scene.shapes():
    if shape.id() == "large-box": # arbitrary choice
        large_box_ptr = mi.ShapePtr(shape)
assert large_box_ptr is not None


# Trace a bunch of rays
x = dr.linspace(mi.Float, 0, 1, 10)
y = dr.linspace(mi.Float, 0, 1, 10)
points = dr.meshgrid(x, y)
ray, _ = scene.sensors()[0].sample_ray(
    time=0.,
    sample1=0.,…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wjakob
Comment options

@itsghaniz
Comment options

Answer selected by merlinND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants