Im trying to render a netcdf file i got these included
#include <vtkNetCDFReader.h>
#include <vtkSmartPointer.h>
#include <vtkDataSetMapper.h>
#include <vtkActor.h>
#include <vtkAlgorithm.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
and i have this code inside my int main
vtkSmartPointer<vtkNetCDFReader> reader =
vtkSmartPointer<vtkNetCDFReader>::New();
reader->SetFileName("C:/Users/Admin/Desktop/BOLTgui/BOLT/OR_ABI-L2-ACMF-M6_G18_s20230880050215_e20230880059523_c20230880100259.nc");
reader->Update();
vtkSmartPointer<vtkDataSetMapper> mapper =
vtkSmartPointer<vtkDataSetMapper>::New();
mapper->SetInputConnection(reader->GetOutputPort());
vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
//While loop
// Draw the model
glBegin(GL_TRIANGLES);
for (size_t i = 0; i < indices.size(); i++) {
glTexCoord2f(texcoords[2 * i], texcoords[2 * i + 1]);
glVertex3f(vertices[3 * i], vertices[3 * i + 1], vertices[3 * i + 2]);
}
if (leftButtonPressed) {
// Calculate the mouse movement since the last frame
sf::Vector2i currentMousePosition = sf::Mouse::getPosition(window);
sf::Vector2i mouseMovement = currentMousePosition - previousMousePosition;
previousMousePosition = currentMousePosition;
// Calculate the rotation angles based on the mouse movement
rotationAngleX += mouseMovement.x * 0.5f;
rotationAngleY += mouseMovement.y * 0.5f;
}
glEnd();
if (event.type == sf::Event::MouseButtonPressed) {
if (event.mouseButton.button == sf::Mouse::Left) {
sf::Vector2i mousePos = sf::Mouse::getPosition(window);
if (button13.getGlobalBounds().contains(mousePos.x, mousePos.y)) {
showWindDirection = !showWindDirection;
}
}
}
if (showWindDirection) {
// Define the values for grid size and spacing
int gridRows = 4;
int gridCols = 4;
float gridSpacingX = 1.0f;
float gridSpacingY = 1.0f;
float quadWidth = 0.02f;
float quadHeight = 0.02f;
float offsetX = 0.3f; // Add an x-axis offset
float offsetY = 0.3f; // Add a y-axis offset
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, windDirTextureId);
glPushMatrix();
glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
// Calculate the radius of the sphere
const double R = 1.0 * 0.4666;
// Calculate the angle between each grid cell
float angleX = 360.0f / gridCols;
float angleY = 180.0f / gridRows;
for (int row = 0; row < gridRows; ++row) {
for (int col = 0; col < gridCols; ++col) {
// Calculate the x, y, and z positions of the grid cell
float x = R * sin(angleY * row) * cos(angleX * col);
float y = R * sin(angleY * row) * sin(angleX * col);
float z = R * cos(angleY * row);
// Translate the grid cell to its calculated position
glPushMatrix();
glTranslatef(x, y, z);
renderTexturedQuad(0.0f, 0.0f, quadWidth, quadHeight, windDirTextureId, sf::Color::White);
glPopMatrix();
}
}
glPopMatrix();
glDisable(GL_TEXTURE_2D);
}
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
renderer->AddActor(actor);
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
renderWindowInteractor->Initialize();
// Get the size of the window
int windowWidth = window.getSize().x;
int windowHeight = window.getSize().y;
// Set the size of the render window
renderWindow->SetSize(windowWidth, windowHeight);
// Render the scene
renderWindow->Render();
//rest of the code
when i run the program i keep getting this error in a VTK Output window
Generic Warning: In vtkNetCDFReader.cxx, line 96
Unknown netCDF variable type 7
ERROR: In vtkExecutive.cxx, line 741
vtkCompositeDataPipeline (0000025B4BA06C50): Algorithm vtkNetCDFReader (0000025B4B904440) returned failure for request: vtkInformation (0000025B4BA2EAD0)
Debug: Off
Modified Time: 114
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
anyone got any solutions how to fix this error