VTK With Oculus Rift - Problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK With Oculus Rift - Problem

medsim

Hello,

 

I am having problem running the VTKRenderingOculusCxxTests program. I get the following error -- see the attached picture.

I am using Visual Studio 2013 and the latest Oculus SDK 1.130.

 

Any help is greatly appreciated.

 

Thanks,

 

Ganesh Sankaranarayanan Ph.D.

Assistant Director, Center for Evidence Based Simulation

Baylor University Medical Center, Dallas

 

Clinical Associate Professor

Department of Surgery

Texas A&M Health Science Center

Office: 214-820-6755

 

 

 


The information contained in this e-mail may be privileged and/or confidential, and protected from disclosure, and no waiver of any attorney-client, work product, or other privilege is intended. If you are the intended recipient, further disclosures are prohibited without proper authorization. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden and possibly a violation of federal or state law and regulations. The sender and Baylor Scott & White Health, and its affiliated entities, hereby expressly reserve all privileges and confidentiality that might otherwise be waived as a result of an erroneous or misdirected e-mail transmission. No employee or agent is authorized to conclude any binding agreement on behalf of Baylor Scott & White Health, or any affiliated entity, by e-mail without express written confirmation by the CEO, the Senior Vice President of Supply Chain Services or other duly authorized representative of Baylor Scott & White Health.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

Capture.PNG (21K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

vtkPolyPlane problem

VTK - Users mailing list
Hi
I need to use vtkCutter to cut a vtkStructuredGrid, but not using a simple vtkPlane: what I need is something more complex.
I need to use a polyline, and extrude it on Z direction, to specify a surface more complex then a simple vtkPlane.
It looks that vtkPolyPlane is what I need, but when I use it I have a problem: the cut is done quite correctly along the polyline specified, but also appear some other piece of cut in some other position.
The picture attached shows the problem.
I tried more grid sizes, and different polylines (different length or shapes), but there is quite always this strange extra surfaces added.
I am not sure if it is a correct result of this filter.... or a bug.
Anyone can help?
Matteo




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkPolyPlane problem

VTK - Users mailing list
Hi
Let me add my test code to my previous message:


vtkSmartPointer<vtkStructuredGrid> structuredGrid =
        vtkSmartPointer<vtkStructuredGrid>::New();

    vtkSmartPointer<vtkPoints> points =
        vtkSmartPointer<vtkPoints>::New();

    const int Size=20;

    int i, j, k;

    for(k = 0; k < Size; k++)
        for(j = 0; j < Size; j++)
            for(i = 0; i < Size; i++)
                points->InsertNextPoint(i, j, k);

    // Specify the dimensions of the grid
    structuredGrid->SetDimensions(Size,Size,Size);
    structuredGrid->SetPoints(points);

    // Cutter

#if 0
    vtkSmartPointer<vtkPlane> plane =
        vtkSmartPointer<vtkPlane>::New();
    plane->SetOrigin(Size/2,0,0);
    plane->SetNormal(1,0,0);
#else
    const int N=3;
       
    const double Step10=(Size-1)/10.0;

    vtkPoints *cutPts = vtkPoints::New();
    cutPts->SetNumberOfPoints(N);

    {
        i=0;
        cutPts->SetPoint(i++, 1*Step10, 1*Step10, 0);
        cutPts->SetPoint(i++, 5*Step10, 5*Step10, 0);
        cutPts->SetPoint(i++, 5*Step10, 8*Step10, 0);
        ASSERT(i==N);
    }

    int* idCutPts = new int[N];
    for(i = 0; i < N; i++)
        idCutPts[i] = i;
   
    vtkSmartPointer<vtkPolyLine> PolyLine =
        vtkSmartPointer<vtkPolyLine>::New();
    PolyLine->Initialize(N, idCutPts, cutPts);

    vtkSmartPointer<vtkPolyPlane> plane =
        vtkSmartPointer<vtkPolyPlane>::New();
    plane->SetPolyLine(PolyLine);

#endif

    vtkSmartPointer<vtkCutter> cutter =
        vtkSmartPointer<vtkCutter>::New();
        cutter->SetCutFunction(plane);
        cutter->SetInputData(structuredGrid);
        cutter->Update();

    vtkSmartPointer<vtkPolyDataMapper> cutterMapper =
        vtkSmartPointer<vtkPolyDataMapper>::New();
    cutterMapper->SetInputConnection( cutter->GetOutputPort());

    // Create plane actor
    vtkSmartPointer<vtkActor> planeActor =
        vtkSmartPointer<vtkActor>::New();
        planeActor->GetProperty()->SetColor(1.0,1.0,0);
        planeActor->GetProperty()->SetLineWidth(2);
        planeActor->SetMapper(cutterMapper);

    // Create a mapper and actor
    vtkSmartPointer<vtkDataSetMapper> mapper =
        vtkSmartPointer<vtkDataSetMapper>::New();
#if VTK_MAJOR_VERSION <= 5
    mapper->SetInputConnection(structuredGrid->GetProducerPort());
#else
    mapper->SetInputData(structuredGrid);
#endif
 
    vtkSmartPointer<vtkActor> actor =
        vtkSmartPointer<vtkActor>::New();
        actor->SetMapper(mapper);
        actor->GetProperty()->SetRepresentationToWireframe();

    // Create a renderer, render window, and interactor
    vtkSmartPointer<vtkRenderer> renderer =
        vtkSmartPointer<vtkRenderer>::New();
    vtkSmartPointer<vtkRenderWindow> renderWindow =
        vtkSmartPointer<vtkRenderWindow>::New();
        renderWindow->AddRenderer(renderer);
    vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
        vtkSmartPointer<vtkRenderWindowInteractor>::New();
        renderWindowInteractor->SetRenderWindow(renderWindow);

    // Add the actor to the scene
    renderer->AddActor(actor);
    renderer->AddActor(planeActor);
    renderer->SetBackground(.3, .6, .3); // Background color

    // Render and interact
    renderWindow->Render();
    renderWindowInteractor->Start();




Il 05/04/2017 10:48, Matteo via vtkusers ha scritto:
Hi
I need to use vtkCutter to cut a vtkStructuredGrid, but not using a simple vtkPlane: what I need is something more complex.
I need to use a polyline, and extrude it on Z direction, to specify a surface more complex then a simple vtkPlane.
It looks that vtkPolyPlane is what I need, but when I use it I have a problem: the cut is done quite correctly along the polyline specified, but also appear some other piece of cut in some other position.
The picture attached shows the problem.
I tried more grid sizes, and different polylines (different length or shapes), but there is quite always this strange extra surfaces added.
I am not sure if it is a correct result of this filter.... or a bug.
Anyone can help?
Matteo





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkPolyPlane problem

VTK - Users mailing list
Hi
I truly need to find a way to have a 'cut' along something not strictly planar, if nobody can solve the problem related vtkPolyPlane (see below) I will be very glad also if someone can suggest some other way to get a similar result.
Thank You
Matteo

Il 05/04/2017 15:24, Matteo via vtkusers ha scritto:
Hi
Let me add my test code to my previous message:


vtkSmartPointer<vtkStructuredGrid> structuredGrid =
         vtkSmartPointer<vtkStructuredGrid>::New();

     vtkSmartPointer<vtkPoints> points =
         vtkSmartPointer<vtkPoints>::New();

     const int Size=20;

     int i, j, k;

     for(k = 0; k < Size; k++)
         for(j = 0; j < Size; j++)
             for(i = 0; i < Size; i++)
                 points->InsertNextPoint(i, j, k);

     // Specify the dimensions of the grid
     structuredGrid->SetDimensions(Size,Size,Size);
     structuredGrid->SetPoints(points);

     // Cutter

#if 0
     vtkSmartPointer<vtkPlane> plane =
         vtkSmartPointer<vtkPlane>::New();
     plane->SetOrigin(Size/2,0,0);
     plane->SetNormal(1,0,0);
#else
     const int N=3;
        
     const double Step10=(Size-1)/10.0;

     vtkPoints *cutPts = vtkPoints::New();
     cutPts->SetNumberOfPoints(N);

     {
         i=0;
         cutPts->SetPoint(i++, 1*Step10, 1*Step10, 0);
         cutPts->SetPoint(i++, 5*Step10, 5*Step10, 0);
         cutPts->SetPoint(i++, 5*Step10, 8*Step10, 0);
         ASSERT(i==N);
     }

     int* idCutPts = new int[N];
     for(i = 0; i < N; i++)
         idCutPts[i] = i;
    
     vtkSmartPointer<vtkPolyLine> PolyLine =
         vtkSmartPointer<vtkPolyLine>::New();
     PolyLine->Initialize(N, idCutPts, cutPts);

     vtkSmartPointer<vtkPolyPlane> plane =
         vtkSmartPointer<vtkPolyPlane>::New();
     plane->SetPolyLine(PolyLine);

#endif

     vtkSmartPointer<vtkCutter> cutter =
         vtkSmartPointer<vtkCutter>::New();
         cutter->SetCutFunction(plane);
         cutter->SetInputData(structuredGrid);
         cutter->Update();

     vtkSmartPointer<vtkPolyDataMapper> cutterMapper =
         vtkSmartPointer<vtkPolyDataMapper>::New();
     cutterMapper->SetInputConnection( cutter->GetOutputPort());

     // Create plane actor
     vtkSmartPointer<vtkActor> planeActor =
         vtkSmartPointer<vtkActor>::New();
         planeActor->GetProperty()->SetColor(1.0,1.0,0);
         planeActor->GetProperty()->SetLineWidth(2);
         planeActor->SetMapper(cutterMapper);

     // Create a mapper and actor
     vtkSmartPointer<vtkDataSetMapper> mapper =
         vtkSmartPointer<vtkDataSetMapper>::New();
#if VTK_MAJOR_VERSION <= 5
     mapper->SetInputConnection(structuredGrid->GetProducerPort());
#else
     mapper->SetInputData(structuredGrid);
#endif
 
     vtkSmartPointer<vtkActor> actor =
         vtkSmartPointer<vtkActor>::New();
         actor->SetMapper(mapper);
         actor->GetProperty()->SetRepresentationToWireframe();

     // Create a renderer, render window, and interactor
     vtkSmartPointer<vtkRenderer> renderer =
         vtkSmartPointer<vtkRenderer>::New();
     vtkSmartPointer<vtkRenderWindow> renderWindow =
         vtkSmartPointer<vtkRenderWindow>::New();
         renderWindow->AddRenderer(renderer);
     vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
         vtkSmartPointer<vtkRenderWindowInteractor>::New();
         renderWindowInteractor->SetRenderWindow(renderWindow);

     // Add the actor to the scene
     renderer->AddActor(actor);
     renderer->AddActor(planeActor);
     renderer->SetBackground(.3, .6, .3); // Background color

     // Render and interact
     renderWindow->Render();
     renderWindowInteractor->Start();




Il 05/04/2017 10:48, Matteo via vtkusers ha scritto:
Hi
I need to use vtkCutter to cut a vtkStructuredGrid, but not using a simple vtkPlane: what I need is something more complex.
I need to use a polyline, and extrude it on Z direction, to specify a surface more complex then a simple vtkPlane.
It looks that vtkPolyPlane is what I need, but when I use it I have a problem: the cut is done quite correctly along the polyline specified, but also appear some other piece of cut in some other position.
The picture attached shows the problem.
I tried more grid sizes, and different polylines (different length or shapes), but there is quite always this strange extra surfaces added.
I am not sure if it is a correct result of this filter.... or a bug.
Anyone can help?
Matteo





_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers