Jump to content

mpatton

Community Members
  • Posts

    6
  • Joined

  • Last visited

mpatton's Achievements

Tiro

Tiro (1/14)

0

Reputation

  1. Hi all, I wanted to test out some mods ive made to 0a.d. on andriod... Is there steps to compiling 0a.d. for andriod on windows or is it only setup for linux @ this stage? thnaks in advance Michael
  2. Cool thanks for that. My problem must now be with the way I get the camera normal matrix or world origin position for it, though they look correct to me... I'm going to post my calculations here, if anyone can spot a problem with what I'm doing any help would be greatly appreciated /*Camera Normal Matrix*/ CMatrix3D cameraInverse; glGetFloatv(GL_MODELVIEW_MATRIX, cameraInverse._data); CMatrix3D cameraNormalMatrix = cameraInverse.GetInverse().GetTranspose(); /*World Origin*/ CVector4D worldOrigin; worldOrigin.X = CVector4D(cameraInverse._11, cameraInverse._12, cameraInverse._13, cameraInverse._14).Dot(CVector4D(0.0, 0.0, 0.0, 1.0)); worldOrigin.Y = CVector4D(cameraInverse._21, cameraInverse._22, cameraInverse._23, cameraInverse._44).Dot(CVector4D(0.0, 0.0, 0.0, 1.0)); worldOrigin.Z = CVector4D(cameraInverse._31, cameraInverse._32, cameraInverse._33, cameraInverse._44).Dot(CVector4D(0.0, 0.0, 0.0, 1.0)); worldOrigin.W = CVector4D(cameraInverse._41, cameraInverse._42, cameraInverse._43, cameraInverse._44).Dot(CVector4D(0.0, 0.0, 0.0, 1.0)); Ideally here I would have like to have just done cameraNormalMatrix * CVector4D(0.0, 0.0, 0.0, 1.0); however I could not see any function to do this calculation. Is there one? thanks in advance Michael
  3. Hi all, More of a general question about debuging code in 0 a.d. I've got some simple printf statements that I would like to appear in the console to see if my calculations are correct, however nothing appears to be printing. I'm assuming your re-routing STD out or something somewhere. In any case how can I get my stuff to print out? Position of the print statements in the code is within TerrainRenderer.cpp just before the shaders are used. thanks in advance Michael
  4. Hi all, I having trouble getting the terrain mesh size in world space which I need to do some distance calculations in the vertex shader. I have the following code in TerrainRender.cpp which I though would work, but doesn't... shaderSolid->Uniform("meshSize", (float)(g_Game->GetWorld()->GetTerrain()->GetTilesPerSide() * TERRAIN_TILE_SIZE)); Basically what I need it for is to range the vertices e.g. -1 to 1, or 0 to 1 say. Any ideas? Also, is there some kind of radius or diameter used for circular terrain's? if I could grab that information as well that would help me a lot. thanks in advance Michael
  5. Hi, I'm kind of new to 0 A.d. and was looking for a little help. I've been working on some terrain deformation test code in a opengl/glsl program I wrote that I would like to try and port into 0 a.d. for some testing. My terrain manipulation code is applied to terrain vertices in the vertex shader, so I have been looking for where terrain rendering is past to the shader in 0 a.d. I believe it is done in TerrainRender.cpp - CShaderProgramPtr shaderBase(shaderManager.LoadProgram("terrain_base", defBasic)); where the terrain shader is set, however I can't seem to find the actual vertex and fragment code for the shader. I've been looking for hours now and can't seem to find it any where. Any help as to where I can locate the vertex and fragment code for where the terrain is rendered would be greatly appreciated. thanks in advance Michael May have found it... terrain_common.vp
×
×
  • Create New...