Subject: CGAL users discussion list
List archive
[cgal-discuss] How to get the primitive from an AABB Tree from the first intersection?
Chronological Thread
- From: Rash <>
- To:
- Subject: [cgal-discuss] How to get the primitive from an AABB Tree from the first intersection?
- Date: Tue, 3 Jul 2018 09:06:17 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:DBfBiBBuVdLu+XvIA2wXUyQJP3N1i/DPJgcQr6AfoPdwSPrypcbcNUDSrc9gkEXOFd2Cra4c1ayO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhTexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKT43/nzUhMJ+gq1Urw6uqRNkzo7IYoyYLuZycr/TcN4YQ2dKQ8ZfVzZGAoO5d4YBE/AOPf1Yr4LgoFYOtwGxBRKsBOPu1zBFnXr23aw+0+s7DQ7G2wkgE8gTv3vKtdj4MroZX+OtzKTQzjjOb+la1Srz5YTSbxwsr/WBUahtfcfSykQjDx7Jg1aTpID/Oz6Y1/4Bv3WY4uZ+T+6jlXIrpgF3rzOy3MkjkJPJiZgQyl3c9SV23oI1JdqgRUFmfNGoDZ9dui6EO4Z5WM8iQHtnuD0hyrIYo567YjYFyI49yxHDbPyHdpCE4hPlVOmPPTd1nHFodbKlixqv/0Ws0PDwW8ew3VpQsyZIkdrBumgI1xPJ68iHTvV9/l2m2TaKzw3T8PtLIVs0laraNpEs2bswlpsXsUvZAiD2n0D2gLWLeUo64uSo8fjoYq36pp+AMI95kh3xMqs0lcy7GOg3LwkOX3OH9uShz73j5lb0QK5Kj/0ziqnWqorWJcUdpq6jAg9ayJwv6xilD2Tu7NNNlnYOKBdJeQmMkpPyE1DIOvHxS/ml0Hq2lzI+/fndPvW1GJzWLnnPuLLgeb927EsaxAdlnoMX3I5dFrxUeKG7YUT2rtGNVkZoYTzx+P7uDZBG7q1bXGuOBqGDN6aL6w2N5+YmKO6JIoMY6m6kd6oVosX2hHp8omczOLGz1MJNOnW5Gv1tJEDfbXe+2o5cQ1dPhRI3SanRsHPHUTNXYCzpDa4wv2BnUt7gDo7YXY23nrGbmiy8G88Oaw==
Hi guys,
for learning CGAL I wanted to write a small ray tracerIt works fine for hit detection and but I am not able to get the primitive which the ray has hit. So I can't compute the normal of the primitve.
#include <CGAL/AABB_tree.h>
#include <CGAL/Polyhedron_3.h>
typedef CGAL::AABB_face_graph_triangle_primitive<Polyhedron> Primitive;
boost::optional<Primitive_id> hit = tree.first_intersected_primitive(rays[this->transformCoordinates(y,x)]);
//okay we have a hit. Nice but how do we get the primitve?
std::cout << *hit << std::endl; //does not work, strange iterrator
std::cout << hit << std::endl; //does not work
std::cout << &hit << std::endl; //damn
std::cout << boost::get<Point>(&(hit)) << std::endl; //come one
std::cout << boost::get<Point>((hit)) << std::endl; //google doesnt help
std::cout << boost::get<Point>(*hit) << std::endl; //write an email
After using googled for two hours I gave up. Sorry, I am not too familar with boost.
Kind regards
Rashid
- [cgal-discuss] How to get the primitive from an AABB Tree from the first intersection?, Rash, 07/03/2018
- Re: [cgal-discuss] How to get the primitive from an AABB Tree from the first intersection?, Sebastien Loriot (GeometryFactory), 07/09/2018
Archive powered by MHonArc 2.6.18.