Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lil_Lloyd

Member Since 01 Feb 2006
Offline Last Active Jun 05 2013 07:41 AM
-----

#5030655 Frustum culling - culling nearby objects?

Posted by Lil_Lloyd on 10 February 2013 - 04:11 AM

As a complete guess, try transposing your MVPMatrix matrix before extracting the planes from it.

I know when I did this, most of literature that I found was based around matrices that have been constructed to work with row-major vectors, like D3D traditionally did.

 

You know I said this didn't work? Well, before I started normalising the planes properly it didn't. I tried it again last night and it worked PERFECTLY. However, it was only after agonising hours of experimentation that I decided to try this again. Including making a debug view from above with the bounding rectangles shown on screen. Taught me a few things though! Thanks. :)




#5030035 Frustum culling - culling nearby objects?

Posted by Lil_Lloyd on 08 February 2013 - 04:51 AM

OK I just noticed something big, but fixing still hasn't solved the problem

 

void  Frustum::NormalizePlane(int index){
  float normFactor = m_planes[index][0] * m_planes[index][0] + m_planes[index][1] * 
                     m_planes[index][1] + m_planes[index][2] * m_planes[index][2];
  m_planes[index] /= normFactor;
}

 

 

Should have been

 

void  Frustum::NormalizePlane(int index){
  float normFactor = m_planes[index][0] * m_planes[index][0] + m_planes[index][1] * 
                     m_planes[index][1] + m_planes[index][2] * m_planes[index][2];
  normFactor = glm::sqrt(normFactor);
  m_planes[index] /= normFactor;
}

 

I was forgetting to squareroot the length! However I'm still getting weird errors... :(




#5023188 Texture filtering modes and performance boosts

Posted by Lil_Lloyd on 19 January 2013 - 10:05 AM

CDProp, this might not be EXACTLY what you're looking for but Coursera.org has a great course on CUDA and GPU, you learn a lot about bandwidth issues like Hodgman has been mentioning. His input made me think about it actually.




#5022707 Enforcing inherited classes without pure virtual functions?

Posted by Lil_Lloyd on 17 January 2013 - 06:14 PM

I've followed swift coder's advice - namely PalmTree HAS a mesh and a shader. Actually makes everything less of a headache than what I was trying. Interesting discussion though!




#5022193 Texture filtering modes and performance boosts

Posted by Lil_Lloyd on 16 January 2013 - 08:51 AM

JTippetts, thank you also for your explanation. There can never be too many points of view of the same problem, even if they are similar, as the different wording of each answer can convey different aspects with more clarity.




#5022191 Texture filtering modes and performance boosts

Posted by Lil_Lloyd on 16 January 2013 - 08:48 AM

Brother Bob. That is a very informative answer! I have always thought about the cache with regards to Data-Oriented programming and trying to 'sort' virtual function calls in arrays but that's the first time I ever thought about memory look ups on texels. 




#4960954 Player movement and changing rotation depending on the way they are facing

Posted by Lil_Lloyd on 19 July 2012 - 08:55 AM

Micro machines was fun, but I remember it taking a while to get used to. If I see something moving in a downwards direction and I press left I expect it to turn left, and if I want to create some exciting and crazy turns for tracks I'd rather have more intuitive controls.

I thought of a way to do this anyway now:

a switch statement using the avatar's current facing direction:

going counter clockwise from the 3 o'clock or 0 degrees position:

if angle > 0 && angle <= 180:
left rotates left, right rotates right

if angle > 90 && angle <= 270:
up rotates right down rotates left

if angle > 180 && angle <= 360:
left rotates right and right rotates left

if angle > 270 && angle <= 360 && angle <= 90:
down rotates right and up rotates left


#4959921 Possibly a stupidly naive mistake re: camera rotation

Posted by Lil_Lloyd on 17 July 2012 - 02:12 AM

Hey thank you for your advice and suggestions, I managed to solve my problem. The look point was being changed as if it was following a unit circle so the values calculated had a min of -1 and a max of +1. Since my eyepoint had a z value of -8.5 the result of lookPoint - eyePoint for the look Vector was ALWAYS negative. I changed the code to the below, and it now works fine!

void Camera::RotateX(float angle)
{
  m_xRotation += angle;
  if(m_xRotation > 360.0f)
   m_xRotation -= 360.0f;
  if(m_xRotation < 0.0f)
   m_xRotation += 360.0f;
  m_lookVec.y = glm::sin(glm::radians(m_xRotation));
  m_lookVec.z = glm::cos(glm::radians(m_xRotation));
  m_lookPoint = m_eyePoint + m_lookVec;
  m_upVec = glm::cross(m_rightVec,m_lookVec);
  m_viewMatrix = glm::lookAt(m_eyePoint,m_lookPoint,m_upVec);
}



#4945119 Applying texture on a sphere [raytracing]

Posted by Lil_Lloyd on 31 May 2012 - 05:07 PM

This should be of some help...

http://www.flipcode.com/archives/Raytracing_Topics_Techniques-Part_6_Textures_Cameras_and_Speed.shtml


PARTNERS