Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 14 Mar 2009
Offline Last Active Feb 03 2012 08:42 AM

Posts I've Made

In Topic: DirectX bounding sphere weird results

03 February 2012 - 07:58 AM

In Managed Direct3D there are 4 options to use this function. One of them is the one that I wrote above. When I changed it to what you said, like this:
objectRadius = Geometry.ComputeBoundingSphere(vertexData, m.NumberVertices, m.NumberBytesPerVertex, objectCenter)
everything worked great.
BUT, I found that only the meshes that are exported with KW X-port plugin from 3Ds max have this problem. PandaExporter plugin seems to work well with this but unfortunately it doesn't export tangets, so I can't use it.
Thanks for the help.

In Topic: 3D camera vectors

17 October 2010 - 12:23 AM


As for the 'eye' point (the camera position), you can get that be 'un-inverting' that part of the matrix (I can post some code for this if you need it).

I don't understand what you mean but fortunately the eye position is something that I don't have to extract because I have the original. If you mean something else please post the code.

That said, I am really curious as to why you need to do this. Why do you need to extract the eye, at, and up vectors from a view matrix that's already been constructed? What do you need them for?

I'm using this camera class in my project to move in space and I also create a water effect in a plane. So, I have to construct the reflectionViewMatrix at every frame to render the scene to a texture as reflected.
To construct this reflectionViewMatrix I need the original Eye, LookAt, Up, Right vectors. I tried to use the extracted vectors from the viewMatrix but it doesn't work right. Conversely it works fine if I have the original vectors.

In Topic: 3D camera vectors

16 October 2010 - 01:39 PM

Of course these vectors are normalized and thats the problem!
Why is that a problem? Direction vectors are *usually* normalized.

The problem is that I don't want a Direction vector but a Position vector.

Suposing that the LookAt vector that the viewMatrix returns came from this:
zaxis = normal(At - Eye)

do you think that this is going to solve my problem:
LookAtPosition = Eye + zaxis

In Topic: (HLSL) Spot light calculations

16 October 2010 - 12:48 PM

I think I know all the basic maths about vectors and matrices.
You can make a start and we'll see how it goes, if you want. :)

Anyway this is not only for me, this can help others that may have this problem, too.

In Topic: (HLSL) Spot light calculations

16 October 2010 - 12:15 PM

Sorry, this is my fault. I didn't mean that.[embarrass]
I can calculate this direction and any other direction, distance or whatever else
I may need. But I can't find the way to combine them to come to a conclusion.
The complex mathematics are my problem!!!
Is this cone between my EyePosition and my pixel? That's the question!