Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 Apr 2014
Offline Last Active Jul 04 2014 01:16 PM

Posts I've Made

In Topic: opengl camera direction calculation for lookat

03 July 2014 - 06:49 AM

The way i'm doing lookat for my camera:

void Camera::update()
	double sinAlfa = glm::sin(m_alfa * DAG2RAD);
	double sinBeta = glm::sin(m_beta * DAG2RAD);
	double cosAlfa = glm::cos(m_alfa * DAG2RAD);
	double cosBeta = glm::cos(m_beta * DAG2RAD);

	m_viewMatrix = glm::lookAt( m_position, glm::vec3(m_position.x + sinAlfa*cosBeta, m_position.y - sinBeta, m_position.z - cosAlfa*cosBeta), glm::vec3(0.0f, 1.0f, 0.0f));

just counting sin and cos function for each of angles of your camera, and with little math you can count point your camera is looking at. DAG2RAD is just pi/180 to convert my angle to radiants. I dont know if it solves your problem, but i hope it will help.

In Topic: Problem with Deffered Rendering

03 July 2014 - 02:15 AM

Sry i didnt answer, timezone...


But what about texture initializing, i did everything according to the tutorial and there was no line about setting any TexParameter. I checked out values in CodeX and you may be right about this filtering, i will try to save those textures as an image from my code and check results there.


And yeah i will have to think about optimalization, but now it is my least problem.

In Topic: GLSL weird '<' syntax error in vertex shader

11 April 2014 - 09:52 AM

it works, i knew that it is something so simple... I'm just dumb

In Topic: GLSL weird '<' syntax error in vertex shader

11 April 2014 - 09:32 AM

loadTextFile function:

std::string ResourceManager::loadTextFile(const std::string& path)
	std::ifstream file(path);

		OutputDebugStringA("File not found");
		return nullptr;

	std::stringstream stream ;
	stream << file.rdbuf();


	return stream.str();

i cant use cout, becuase i dont have console, but OutputDebugStringA on each of them gives this:



#version 400
in vec3 vector_position;
void main()
gl_Position = vec4(vector_position, 1.0f);
}#version 400
out vec4 color;
void main()
color = vec4(1.0f, 0.0f, 0.0f, 1.0f);


last line dont have '\n', thats why they looked merged




changing to multibyte, didnt do anything

In Topic: GLSL weird '<' syntax error in vertex shader

11 April 2014 - 09:17 AM

Yeah, it is faster to ask on few sites.


Yes, i found this suggestion on stackoverflow, but it changed nothing