librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Clarifying example.hpp in future releases?

Open HippoEug opened this issue 8 years ago • 1 comments

Required Info
Camera Model D400
Firmware Version 05.09.02.00
Operating System & Version Win 10
Kernel Version (Linux Only)
Platform PC
SDK Version 2.16.1
Language C++
Segment others

Issue

Hello, just a quick question; example.hpp is just a file on its own with no README afaik. There are a few comments here and there, but otherwise it is mainly just code. Was wondering if there would be more comments added in the future, or something along this line?

Suggestions

Code Segment 1

// Basic Data Types
struct float3_rs { 
	float x, y, z;
};

struct float2_rs {
	float x, y; 
};

What are float3_rs and float2_rs supposed to represent? (x, y, z) coordinates and (x, y) coordinates respectively?

Code Segment 2

struct rect_rs {
	float x, y;
	float w, h;

	// Create new rect within original boundaries with give aspect ration
	rect_rs adjust_ratio(float2_rs size) const
	{

What does float w, h; suppose to represent?

Code Segment 3

void show(const rect_rs& r) const
	{
		if (!gl_handle)
			return;

		glBindTexture(GL_TEXTURE_2D, gl_handle);
		glEnable(GL_TEXTURE_2D);
		glBegin(GL_QUAD_STRIP);
		glTexCoord2f(0.f, 1.f); glVertex2f(r.x, r.y + r.h);
		glTexCoord2f(0.f, 0.f); glVertex2f(r.x, r.y);
		glTexCoord2f(1.f, 1.f); glVertex2f(r.x + r.w, r.y + r.h);
		glTexCoord2f(1.f, 0.f); glVertex2f(r.x + r.w, r.y);
		glEnd();
		glDisable(GL_TEXTURE_2D);
		glBindTexture(GL_TEXTURE_2D, 0);

		draw_text_rs((int)r.x + 15, (int)r.y + 20, rs2_stream_to_string(stream));
	}

What are all the gl codes supposed to mean? I understand this is more towards the GLFW library rather than RealSrense SDK, but adding some comments on what they do would be a nice touch imho.

Thanks 😸

HippoEug avatar Oct 26 '18 04:10 HippoEug

[Realsense Customer Engineering Team Comment] Ticket being closed due to inactivity for 30+ days