SlideShare una empresa de Scribd logo
1 de 3
Wiki3DVision Forum

General Category => 3D Reconstruction => Topic started by:
dashan on July 19, 2010, 05:25:15 PM



Title: How I display 3D model using imported point cloud
data with VTK
Post by: dashan on July 19, 2010, 05:25:15 PM

Step 1:

 vtkRenderWindow *renWin = vtkRenderWindow::New();

  vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);

Step 2: Input Point Cloud

      FILE *stream;
  if( (stream = fopen( "c:pointcloud.txt", "r" )) == NULL )
  {
      printf( "The file 'data.txt' was not openedn" );
   // return;
  }
  fscanf(stream,"%d", &num);
  for(int i=0;i<num;i++){
     //fscanf(stream,"%f %f %f %d %d %d", &tmpdata[0],
&tmpdata[1],&tmpdata[2], &tmpcol[0], &tmpcol[1],
&tmpcol[2]);//with color
     fscanf(stream,"%f %f %f", &tmpdata[0],
&tmpdata[1],&tmpdata[2]);//without color
     mypoint_1[0]=tmpdata[0];
mypoint_1[1]=tmpdata[1];
     mypoint_1[2]=tmpdata[2];
    //colors->InsertNextTuple3(tmpcol[0], tmpcol[1],
tmpcol[2]);
    cloud_1->InsertNextPoint(mypoint_1);
  }

   fclose(stream);

Step 3:

   vtkPolyData* polydata_1 = vtkPolyData::New();
      polydata_1->SetPoints(cloud_1);

Step 4: Build mesh

   vtkDelaunay2D* del2d_1 = vtkDelaunay2D::New();
   del2d_1->SetInput((vtkPointSet*)polydata_1);
   del2d_1->SetTolerance(0.005);
   del2d_1->Update();

Step 5:
  vtkRenderer* ren_surf = vtkRenderer::New(); // create a render
  ren_surf->SetBackground(0.475, 0.722, 0.15);
  renWin->AddRenderer(ren_surf); // bind render with a render
window
  vtkDataSetMapper* mapper = vtkDataSetMapper::New();
  mapper->SetInput(del2d_1->GetOutput());

 vtkActor* act = vtkActor::New();
 act->SetMapper(mapper);
 ren_surf->AddActor(act);

 renWin->SetSize(800, 600);
 iren->Initialize();
iren->Start();
 renWin->Render();

Completed! The dispay image is attached below.


    Powered by SMF 1.1.11 | SMF © 2006-2009,
               Simple Machines LLC

Más contenido relacionado

La actualidad más candente

A gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojureA gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojure
Paul Lam
 
rx.js make async programming simpler
rx.js make async programming simplerrx.js make async programming simpler
rx.js make async programming simpler
Alexander Mostovenko
 
Deep dumpster diving 2010
Deep dumpster diving 2010Deep dumpster diving 2010
Deep dumpster diving 2010
RonnBlack
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
mmirfan
 

La actualidad más candente (20)

Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
NS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt IIINS2: AWK and GNUplot - PArt III
NS2: AWK and GNUplot - PArt III
 
A gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojureA gentle introduction to functional programming through music and clojure
A gentle introduction to functional programming through music and clojure
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.Exploring Parallel Merging In GPU Based Systems Using CUDA C.
Exploring Parallel Merging In GPU Based Systems Using CUDA C.
 
Ns2 ns3 training in mohali
Ns2 ns3 training in mohaliNs2 ns3 training in mohali
Ns2 ns3 training in mohali
 
Single qubit-gates operations
Single qubit-gates operationsSingle qubit-gates operations
Single qubit-gates operations
 
Add Some Fun to Your Functional Programming With RXJS
Add Some Fun to Your Functional Programming With RXJSAdd Some Fun to Your Functional Programming With RXJS
Add Some Fun to Your Functional Programming With RXJS
 
rx.js make async programming simpler
rx.js make async programming simplerrx.js make async programming simpler
rx.js make async programming simpler
 
Deep dumpster diving 2010
Deep dumpster diving 2010Deep dumpster diving 2010
Deep dumpster diving 2010
 
201801 CSE240 Lecture 12
201801 CSE240 Lecture 12201801 CSE240 Lecture 12
201801 CSE240 Lecture 12
 
Sujet bac info 2013 g1, g2 et g3 avec correction
Sujet bac info 2013 g1, g2 et g3 avec correctionSujet bac info 2013 g1, g2 et g3 avec correction
Sujet bac info 2013 g1, g2 et g3 avec correction
 
Concurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdfConcurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdf
 
Linux-Permission
Linux-PermissionLinux-Permission
Linux-Permission
 
Conversion of data types in java
Conversion of data types in javaConversion of data types in java
Conversion of data types in java
 
Tracing and awk in ns2
Tracing and awk in ns2Tracing and awk in ns2
Tracing and awk in ns2
 
Kapacitor Alert Topic handlers
Kapacitor Alert Topic handlersKapacitor Alert Topic handlers
Kapacitor Alert Topic handlers
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
Moar tools for asynchrony!
Moar tools for asynchrony!Moar tools for asynchrony!
Moar tools for asynchrony!
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
 

Similar a Vtk point cloud important

All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
Moriyoshi Koizumi
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
 

Similar a Vtk point cloud important (20)

Technical Report Vawtrak v2
Technical Report Vawtrak v2Technical Report Vawtrak v2
Technical Report Vawtrak v2
 
Computer networks and Information security 16SCN16
Computer networks and Information security 16SCN16Computer networks and Information security 16SCN16
Computer networks and Information security 16SCN16
 
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache BeamGDG Jakarta Meetup - Streaming Analytics With Apache Beam
GDG Jakarta Meetup - Streaming Analytics With Apache Beam
 
Correcting Common Async/Await Mistakes in .NET
Correcting Common Async/Await Mistakes in .NETCorrecting Common Async/Await Mistakes in .NET
Correcting Common Async/Await Mistakes in .NET
 
KDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics TutorialKDD 2016 Streaming Analytics Tutorial
KDD 2016 Streaming Analytics Tutorial
 
Correcting Common .NET Async/Await Mistakes
Correcting Common .NET Async/Await MistakesCorrecting Common .NET Async/Await Mistakes
Correcting Common .NET Async/Await Mistakes
 
Mintz q207
Mintz q207Mintz q207
Mintz q207
 
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in GoCapturing NIC and Kernel TX and RX Timestamps for Packets in Go
Capturing NIC and Kernel TX and RX Timestamps for Packets in Go
 
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
 
Correcting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptxCorrecting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptx
 
Vtk Image procesing
Vtk Image procesingVtk Image procesing
Vtk Image procesing
 
Vtk file
Vtk   fileVtk   file
Vtk file
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Correcting Common Async Await Mistakes in .NET
Correcting Common Async Await Mistakes in .NET Correcting Common Async Await Mistakes in .NET
Correcting Common Async Await Mistakes in .NET
 
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
 
A Stealthy Stealers - Spyware Toolkit and What They Do
A Stealthy Stealers - Spyware Toolkit and What They DoA Stealthy Stealers - Spyware Toolkit and What They Do
A Stealthy Stealers - Spyware Toolkit and What They Do
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
Receipt processing with Google Cloud Platform and the Google Assistant
Receipt processing with Google Cloud Platform and the Google AssistantReceipt processing with Google Cloud Platform and the Google Assistant
Receipt processing with Google Cloud Platform and the Google Assistant
 
Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17Hopping in clouds - phpuk 17
Hopping in clouds - phpuk 17
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 

Más de Rohit Bapat

Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016
Rohit Bapat
 
मर्म Poems by grace
मर्म   Poems by graceमर्म   Poems by grace
मर्म Poems by grace
Rohit Bapat
 
Coordinate transformations
Coordinate transformationsCoordinate transformations
Coordinate transformations
Rohit Bapat
 
Open gl programming guide
Open gl programming guideOpen gl programming guide
Open gl programming guide
Rohit Bapat
 
Modern introduction to_grid-generation
Modern introduction to_grid-generationModern introduction to_grid-generation
Modern introduction to_grid-generation
Rohit Bapat
 
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zinggFundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
Rohit Bapat
 
Photoshop tutorial
Photoshop tutorialPhotoshop tutorial
Photoshop tutorial
Rohit Bapat
 
माणसाचं आयुष्य
माणसाचं आयुष्यमाणसाचं आयुष्य
माणसाचं आयुष्य
Rohit Bapat
 

Más de Rohit Bapat (13)

Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016
 
मर्म Poems by grace
मर्म   Poems by graceमर्म   Poems by grace
मर्म Poems by grace
 
Coordinate transformations
Coordinate transformationsCoordinate transformations
Coordinate transformations
 
Csharp ebook
Csharp ebookCsharp ebook
Csharp ebook
 
Open gl programming guide
Open gl programming guideOpen gl programming guide
Open gl programming guide
 
Cpp essentials
Cpp essentialsCpp essentials
Cpp essentials
 
Modern introduction to_grid-generation
Modern introduction to_grid-generationModern introduction to_grid-generation
Modern introduction to_grid-generation
 
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zinggFundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
Fundamentals of computational_fluid_dynamics_-_h._lomax__t._pulliam__d._zingg
 
Fourier
FourierFourier
Fourier
 
Photoshop tutorial
Photoshop tutorialPhotoshop tutorial
Photoshop tutorial
 
मात्र
मात्रमात्र
मात्र
 
माणसाचं आयुष्य
माणसाचं आयुष्यमाणसाचं आयुष्य
माणसाचं आयुष्य
 
काल
कालकाल
काल
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Vtk point cloud important

  • 1. Wiki3DVision Forum General Category => 3D Reconstruction => Topic started by: dashan on July 19, 2010, 05:25:15 PM Title: How I display 3D model using imported point cloud data with VTK Post by: dashan on July 19, 2010, 05:25:15 PM Step 1: vtkRenderWindow *renWin = vtkRenderWindow::New(); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); Step 2: Input Point Cloud FILE *stream; if( (stream = fopen( "c:pointcloud.txt", "r" )) == NULL ) { printf( "The file 'data.txt' was not openedn" ); // return; } fscanf(stream,"%d", &num); for(int i=0;i<num;i++){ //fscanf(stream,"%f %f %f %d %d %d", &tmpdata[0], &tmpdata[1],&tmpdata[2], &tmpcol[0], &tmpcol[1], &tmpcol[2]);//with color fscanf(stream,"%f %f %f", &tmpdata[0], &tmpdata[1],&tmpdata[2]);//without color mypoint_1[0]=tmpdata[0];
  • 2. mypoint_1[1]=tmpdata[1]; mypoint_1[2]=tmpdata[2]; //colors->InsertNextTuple3(tmpcol[0], tmpcol[1], tmpcol[2]); cloud_1->InsertNextPoint(mypoint_1); } fclose(stream); Step 3: vtkPolyData* polydata_1 = vtkPolyData::New(); polydata_1->SetPoints(cloud_1); Step 4: Build mesh vtkDelaunay2D* del2d_1 = vtkDelaunay2D::New(); del2d_1->SetInput((vtkPointSet*)polydata_1); del2d_1->SetTolerance(0.005); del2d_1->Update(); Step 5: vtkRenderer* ren_surf = vtkRenderer::New(); // create a render ren_surf->SetBackground(0.475, 0.722, 0.15); renWin->AddRenderer(ren_surf); // bind render with a render window vtkDataSetMapper* mapper = vtkDataSetMapper::New(); mapper->SetInput(del2d_1->GetOutput()); vtkActor* act = vtkActor::New(); act->SetMapper(mapper); ren_surf->AddActor(act); renWin->SetSize(800, 600); iren->Initialize();
  • 3. iren->Start(); renWin->Render(); Completed! The dispay image is attached below. Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC