How to add ScalarValue while adding points?
Posted: Sun Mar 07, 2021 11:45 am
Hello,
I try to add ScalarValue while adding points.
I tried these codes, but nothing happened.
What is the right option?
I try to add ScalarValue while adding points.
I tried these codes, but nothing happened.
Code: Select all
ccPointCloud *pc;
......
pc->setDisplay(m_app->getActiveGLWindow());
pc->addScalarField("DefaultScalarField");
pc->enableScalarField();
pc->setCurrentScalarField(0);
pc->showColors(true);
pc->setVisible(true);
pc->setEnabled(true);
......
pc->reserve(1);
pc->addPoint(CCVector3(ppoint_data->x, ppoint_data->y, ppoint_data->z)); //ppoint_data is from Lidar
pc->getScalarField(0)->addElement(ppoint_data->reflectivity);// Try to add ScalarValue
pc->getScalarField(0)->computeMinAndMax();