normalised cartographic camera

This commit is contained in:
robin committed 2024-05-05 14:50:26 +02:00
1 parent 06315a3d52
commit 346e44da48
8 files changed
+128 -65

No files matched your search

+13 -2
View File
@@ -31,7 +31,14 @@ void SpawnPointCallback::Execute(vtkObject *caller, unsigned long evId, void *ca
int x, y;
interactor->GetEventPosition(x, y);
vtkIdType id = points->InsertNextPoint(x, y, 0);
double worldPos[4] = {2, 0 ,0, 0};
double displayPos[3] = {static_cast<double>(x), static_cast<double>(y), 0.0};
ren->SetDisplayPoint(displayPos);
ren->DisplayToWorld();
ren->GetWorldPoint(worldPos);
cout << "clicked on lon = " << worldPos[0] << " and lat = " << worldPos[1] << endl;
vtkIdType id = points->InsertNextPoint(worldPos[0], worldPos[1], 0);
data->SetPoints(points);
vtkSmartPointer<vtkVertex> vertex = vtkSmartPointer<vtkVertex>::New();
@@ -57,4 +64,8 @@ void SpawnPointCallback::setData(const vtkSmartPointer<vtkPolyData> &data) {
void SpawnPointCallback::setPoints(const vtkSmartPointer<vtkPoints> &points) {
this->points = points;
}
}
void SpawnPointCallback::setRen(const vtkSmartPointer<vtkRenderer> &ren) {
this->ren = ren;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.