In the code below, you're using Group_Primitives for the normal attribute. It should be Group_Points.

HTH,
Vil


On 09/09/11 16:52, Sebastian Elsner wrote:
Just to test I was also using the position vector for the normal vector (the way Sphere.cpp does, if I am not mistaken), but still PoissonMesh errors because it thinks no normals are defined. Is there something I forgot? Please see the geometry_engine below:


oid xyzReader::geometry_engine(Scene& scene, GeometryList& out)
{
    std::ifstream in(filename());
    int obj = 0;
    out.add_object(obj);
    PointList* points = out.writable_points(obj);
Attribute* cf = out.writable_attribute(obj,Group_Points,kColorAttrName,VECTOR4_ATTRIB); Attribute* normals = out.writable_attribute(obj, Group_Primitives, kNormalAttrName, NORMAL_ATTRIB);
    Vector3 pos;
    Vector4 col;
    int r, g, b;
    int n = 0;
    while (in.good())
    {
        out.add_primitive(obj, new Point(Point::POINT,1.0f,n));

        in >> pos.x >> pos.z >> pos.y >> r >> g >> b;
        pos.x=-pos.x;
        points->push_back(pos);

        cf->add(1);
        col.set(r/255.0f,g/255.0f,b/255.0f,1.0f);
        cf->vector4(n) = col;

        normals->add(1);
        normals->normal(n) = pos;

        ++n;
    }
    std::cout<<"number of points loaded: "<<n<<std::endl;
}


Sebastian

--
Vilya Harvey
The Foundry, 6th Floor, Communications Building
48 Leicester Square, London, WC2H 7LT, UK
Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906
Web: www.thefoundry.co.uk

The Foundry Visionmongers Ltd. Registered in England and Wales No: 4642027

_______________________________________________
Nuke-dev mailing list
Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to