Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List point data #9

Open
ZPyrolink opened this issue May 31, 2021 · 0 comments
Open

List point data #9

ZPyrolink opened this issue May 31, 2021 · 0 comments

Comments

@ZPyrolink
Copy link

Hello,

I'm trying to get the list of all the points with their position, color and intensity of a potree project (already converted). To do that, I have added a getColor and getIntensity on the Points class in order to read the rgb and intensity attribute buffer. The problem is that the values returned aren't colors and intensity. Do you have any solution ?

Here is my code :

dvec3 getColor(int64_t i)
{
	shared_ptr<Buffer>& buffer = attributeBuffersMap["rgb"];

	int32_t R, G, B;
	memcpy(&R, buffer -> data_u8 + i * 6 + 0, 2);
	memcpy(&G, buffer -> data_u8 + i * 6 + 2, 2);
	memcpy(&B, buffer -> data_u8 + i * 6 + 4, 2);

	return {R, G, B};
}

int64_t getIntensity(int64_t i)
{
	shared_ptr<Buffer>& buffer = attributeBuffersMap["intensity"];

	int64_t I;
	memcpy(&I, buffer -> data_u8 + i * 2, 2);
		
	return I;
}

Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant