Skip to content
Snippets Groups Projects
Commit 9cf09b97 authored by Andrew Maclean's avatar Andrew Maclean
Browse files

Merge branch 'VRImprovements' into 'master'

VR improvements

See merge request !342
parents 085c763b 10f51fe1
No related branches found
No related tags found
1 merge request!342VR improvements
Pipeline #406928 passed
...@@ -208,6 +208,7 @@ OpenVROrientedArrow ...@@ -208,6 +208,7 @@ OpenVROrientedArrow
OpenVROrientedCylinder OpenVROrientedCylinder
OpenVRSphere OpenVRSphere
OpenVRTessellatedBoxSource OpenVRTessellatedBoxSource
OpenXRCone
ImageValueRange ImageValueRange
NegativeIndices NegativeIndices
PKMeansClustering PKMeansClustering
......
...@@ -174,10 +174,15 @@ If you are new to VTK then these [tutorials](#tutorial) will help to get you sta ...@@ -174,10 +174,15 @@ If you are new to VTK then these [tutorials](#tutorial) will help to get you sta
[EllipticalCylinder](/Cxx/GeometricObjects/EllipticalCylinder) | Create an elliptical cylinder using extrusion. [EllipticalCylinder](/Cxx/GeometricObjects/EllipticalCylinder) | Create an elliptical cylinder using extrusion.
[EllipticalCylinderDemo](/Cxx/GeometricObjects/EllipticalCylinderDemo) | Show the base and extrusion vector. [EllipticalCylinderDemo](/Cxx/GeometricObjects/EllipticalCylinderDemo) | Show the base and extrusion vector.
[GeometricObjectsDemo](/Cxx/GeometricObjects/GeometricObjectsDemo) | A demonstration of all geometric objects that work the same way. [GeometricObjectsDemo](/Cxx/GeometricObjects/GeometricObjectsDemo) | A demonstration of all geometric objects that work the same way.
[OpenVRFrustum](/Cxx/GeometricObjects/OpenVRFrustum) | VTK + OpenVR Example. [OpenVRCone](/Cxx/GeometricObjects/OpenVRCone) | Show a cone in VR using OpenVR.
[OpenVROrientedArrow](/Cxx/GeometricObjects/OpenVROrientedArrow) | VTK + OpenVR Example. [OpenVRCube](/Cxx/GeometricObjects/OpenVRCube) | Show a cube in VR using OpenVR.
[OpenVROrientedCylinder](/Cxx/GeometricObjects/OpenVROrientedCylinder) | VTK + OpenVR Example. [OpenVRCylinder](/Cxx/GeometricObjects/OpenVRCylinder) | Show a cylinder in VR using OpenVR.
[OpenVRTessellatedBoxSource](/Cxx/GeometricObjects/OpenVRTessellatedBoxSource) | VTK + OpenVR Example. [OpenVRFrustum](/Cxx/GeometricObjects/OpenVRFrustum) | Show a frustum in VR using OpenVR.
[OpenVROrientedArrow](/Cxx/GeometricObjects/OpenVROrientedArrow) | Show an oriented arrow in VR using OpenVR.
[OpenVROrientedCylinder](/Cxx/GeometricObjects/OpenVROrientedCylinder) | Show an oriented cylinder in VR using OpenVR.
[OpenVRSphere](/Cxx/GeometricObjects/OpenVRSphere) | Show a sphere in VR using OpenVR.
[OpenVRTessellatedBoxSource](/Cxx/GeometricObjects/OpenVRTessellatedBoxSource) | Show a tesselated box in VR using OpenVR.
[OpenXRCone](/Cxx/GeometricObjects/OpenXRCone) | Show a cone in VR using OpenXR.
[PlaneSourceDemo](/Cxx/GeometricObjects/PlaneSourceDemo) | Display the instance variables that define a vtkPlaneSource. [PlaneSourceDemo](/Cxx/GeometricObjects/PlaneSourceDemo) | Display the instance variables that define a vtkPlaneSource.
[Planes](/Cxx/GeometricObjects/Planes) | [Planes](/Cxx/GeometricObjects/Planes) |
[PlanesIntersection](/Cxx/GeometricObjects/PlanesIntersection) | [PlanesIntersection](/Cxx/GeometricObjects/PlanesIntersection) |
...@@ -1148,6 +1153,7 @@ See [this tutorial](http://www.vtk.org/Wiki/VTK/Tutorials/3DDataTypes) for a bri ...@@ -1148,6 +1153,7 @@ See [this tutorial](http://www.vtk.org/Wiki/VTK/Tutorials/3DDataTypes) for a bri
[HAVS](/Cxx/VolumeRendering/HAVSVolumeMapper) | [HAVS](/Cxx/VolumeRendering/HAVSVolumeMapper) |
[IntermixedUnstructuredGrid](/Cxx/VolumeRendering/IntermixedUnstructuredGrid) | mix of poly data and unstructured grid volume mapper. [IntermixedUnstructuredGrid](/Cxx/VolumeRendering/IntermixedUnstructuredGrid) | mix of poly data and unstructured grid volume mapper.
[MinIntensityRendering](/Cxx/VolumeRendering/MinIntensityRendering) | Min intensity rendering. [MinIntensityRendering](/Cxx/VolumeRendering/MinIntensityRendering) | Min intensity rendering.
[OpenVRVolume](/Cxx/VolumeRendering/OpenVRVolume) | Render synthetic volume dataset in VR using OpenVR.
[RayCastIsosurface](/Cxx/VolumeRendering/RayCastIsosurface) | Isosufaces produced by volume rendering. [RayCastIsosurface](/Cxx/VolumeRendering/RayCastIsosurface) | Isosufaces produced by volume rendering.
[SimpleRayCast](/Cxx/VolumeRendering/SimpleRayCast) | Volume rendering of a high potential iron protein. [SimpleRayCast](/Cxx/VolumeRendering/SimpleRayCast) | Volume rendering of a high potential iron protein.
[SmartVolumeMapper](/Cxx/VolumeRendering/SmartVolumeMapper) | Smart volume mapper. [SmartVolumeMapper](/Cxx/VolumeRendering/SmartVolumeMapper) | Smart volume mapper.
......
...@@ -50,6 +50,7 @@ Requires_Module(OpenVROrientedArrow RenderingOpenVR) ...@@ -50,6 +50,7 @@ Requires_Module(OpenVROrientedArrow RenderingOpenVR)
Requires_Module(OpenVROrientedCylinder RenderingOpenVR) Requires_Module(OpenVROrientedCylinder RenderingOpenVR)
Requires_Module(OpenVRSphere RenderingOpenVR) Requires_Module(OpenVRSphere RenderingOpenVR)
Requires_Module(OpenVRTessellatedBoxSource RenderingOpenVR) Requires_Module(OpenVRTessellatedBoxSource RenderingOpenVR)
Requires_Module(OpenXRCone RenderingOpenXR)
Requires_Module(ParametricObjectsDemo cli11) Requires_Module(ParametricObjectsDemo cli11)
Requires_Module(ParametricObjectsDemo fmt) Requires_Module(ParametricObjectsDemo fmt)
......
#include <vtkActor.h>
#include <vtkConeSource.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkOpenXRRenderWindow.h>
#include <vtkOpenXRRenderWindowInteractor.h>
#include <vtkOpenXRRenderer.h>
#include <vtkPolyDataMapper.h>
int main(int argc, char* argv[])
{
// Create a cone along with a mapper and actor for it
vtkNew<vtkConeSource> coneSource;
coneSource->Update();
vtkNew<vtkNamedColors> colors;
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(coneSource->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
// Create OpenXR renderer, render window, and interactor
vtkNew<vtkOpenXRRenderer> renderer;
vtkNew<vtkOpenXRRenderWindow> renderWindow;
renderWindow->Initialize();
renderWindow->AddRenderer(renderer);
vtkNew<vtkOpenXRRenderWindowInteractor> renderWindowInteractor;
renderWindowInteractor->SetRenderWindow(renderWindow);
// Add the actors to the scene
renderer->AddActor(actor);
renderer->SetBackground(colors->GetColor3d("ForestGreen").GetData());
// Render and interact
renderWindow->Render();
renderWindowInteractor->Start();
return EXIT_SUCCESS;
}
### Description
This example demonstrates rendering of a Cone in OpenXR.
!!! note "WINDOWS USERS"
For the interactions to work, you have to copy the `.json` manifest files from the subfolder Rendering/OpenXR in VTK's source to the working directory in which the example is run!
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment