POV-Ray : Newsgroups : povray.binaries.programming : My idea: Developers need tips! Help me, please! : Re: My idea: Developers need tips! Help me, please! Server Time
18 May 2024 15:56:52 EDT (-0400)
  Re: My idea: Developers need tips! Help me, please!  
From: LanuHum
Date: 2 Oct 2016 16:05:00
Message: <web.57f16723397eea9f7a3e03fe0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 02.10.2016 um 19:27 schrieb LanuHum:
> > clipka <ano### [at] anonymousorg> wrote:
> >
> >> That said, the thing you are looking for is the class `SceneData`
> >> declared in `source/core/scene/scenedata.h`
> >
> > All right. I watched this file.
> >
> >         ~SceneData();
> >
> >         /// list of all shape objects
> >         vector<ObjectPtr> objects;
> >         /// list of all global light sources
> >         vector<LightSource *> lightSources;
> >         /**
> >          *  Create new scene specific data.
> >          */
> >         SceneData(GenericFunctionContextFactory* fcf);
> >
> > A pointer to the object is absent,
>
> I don't know what you mean by that. We have the `vector<ObjectPtr>
> objects` there, nice and square.
>
>
> > How to implement my.cpp?
> >
> > SceneData::SceneData(){};
> >
> > SceneData *scene = new SceneData();
> > for (ulong i = 0; i < numberBlenderObjects; i++){
> >     ObjectPtr *object = new ObjectPtr();
> >     object = BlenderObjects[i];
> >     scene -> objects.push_back(object);}
>
> Uh... no, not exactly:
>
> ObjectPtr is not a class type; it's a /pointer/ to a class type
> (currently a plain C pointer, but might be made a `shared_ptr<>` some
> time in the future). Also, the type it points to is actually an abstract
> polymorphic base type, `ObjectBase`; the type you'll need to instantiate
> depends on the primitive type you want; for example:
>
>    Sphere *pSphere = new Sphere();
>    pSphere->Center = Vector3d(BlenderObjects[i].Center);
>    pSphere->Radius = BlenderObjects[i].Radius;
>    scene->objects.push_back (pSphere);
>
> or:
>
>    Box *pBox = new Box();
>    pBox->bounds[0] = Vector3d(BlenderObjects[i].BottomLeft);
>    pBox->bounds[1] = Vector3d(BlenderObjects[i].TopRight);
>    scene->objects.push_back (pBox);
>
> or:
>
>    Mesh *pMesh = new Mesh();
>    // ...
>    scene->objects.push_back (pMesh);
>
> Note that much of the sanity-checking and precomputing of various stuff
> is still implemented in the parser, rather than the primitive classes
> where it would belong.
>
> Also, in addition to the stuff the parser does while parsing the SDL
> file, there are some additional steps required between the parsing and
> the invocation of the render engine, such as propagating some
> information between parent and child objects, setting up a bounding
> hierarchy to speed up rendering, and other stuff like that.
>
> Don't say I didn't warn you...

:))))
Thank you.
My idea is only useful for animation. To speed up the data transfer very large.
Parents and children do not interest me.
Earlier you wrote me that well write:
sphere{}
sphere{}
sphere{}
than the cycle "for (i=0;i<3;i++)..."

I am most interested in triangles.
I will try to deal with the povray-master/source/core/shape/mesh.h


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.