Jump to content

  • Log In with Google      Sign In   
  • Create Account


JohnnyCode

Member Since 10 Mar 2008
Offline Last Active Today, 03:11 AM
*----

#5167272 Problem With Character Animation

Posted by JohnnyCode on 16 July 2014 - 06:30 PM

maybe it could be left haned to right handed. 3ds max is right handed.

you can transform this fact, toward of your need. You do not need to synchronize base axises as they are made of production. Just apply asunchronous inverting transformation after all of model space deeds. Like including post multyplying needed (asynchronus) transformation towards the very bone one.

 

(Oh, I must flip z axis to be x axis) = asyncrhnous standard post multiplication of all transformations.

 

.... in otehr words. if someone dances good, yet you want to dance with the inverse hand, what do you do? flip mirror tranformation afetr his deed... it is all there.

 

(imagine yoy can control your left hand and your girl is on your right hand, but, yet, you are able to issue stuff to your left hand only! and after it all has been issued  to the left hand holding your girl, your right hand can perform will of your left hand if you refelct it, and that is the hand that pleases your girl)




#5167242 What is software rendering really?

Posted by JohnnyCode on 16 July 2014 - 03:57 PM

rendering is a very well paralelizable issue. CPU (central processing unit) targets serialized demanding problematics (on step 2 I need step 1 result vitaly). Thus, gpu is a parallel pile of processors very conforming to paralely solvalble instruction (think of a web server serving a unique web client - that's where nvidia with tesla units is dominating), even if the gpu processor cores are slow of ferquency, there is many, thus they gulp down and burp over tremendous computation issues that gains paralelism.

 

software rendring is doing those instructions without paralel assisatnce and paralel distribution (or not, carefull).

 

Yet, paralel computation setups at those times suffer from memory access. (thats why gpus compete in memory frequency, rather than in cores frequency and their count)

 




#5167232 Problem With Character Animation

Posted by JohnnyCode on 16 July 2014 - 03:35 PM

first (there is a lot to it, nothing easy), try to load the mesh that gets manipulated by bone matrcies without bone matricies- it will appear refering to spaces missconception of your aplication and of the exporter/producer defined space. You should see the same mesh- but the actual right is actual left (or top bottm...), thus not spottable.

 

I will omit a lot of stuff, but switching from a space where any of the "base vectors=axis" is replaced-refit, cannot be done by symetric transformation (rotaion and translation).

 

You will have to use an (inverse) scaling over the bone matrcies transformation..

 

Go to your modeling program and spectate/analyze base axises defintion, than compare them to your aplication's space axises. If they are not the same layed out, you must perform asymetric transformation over bone matricies.

 

very likely using an identity matrix of -1 instead of 1 on the conflicting axis after the bone transformation .

 

Or you can maintain the same synchronized axises of your aplication space towwards model space, but that is not just viable and prefered




#5167222 glDrawElements without indices?

Posted by JohnnyCode on 16 July 2014 - 03:00 PM

 

"If you're over-committing video RAM you don't start thinking about swapping out resources, you do start thinking about reducing the size of your resources."

 

Texture streaming is just one counter example what you were saying.

It is not counter example, texture streaming alows one to minimize requirement over resources.

 

If you cannot create a resource, becouse of low memory or becouse of bad weather, than a memory counter to prove you you can do so will do nothing just to .. LOL, prove a retarded assumption,

 

You must handle refused instructions on your own responsibility, whaether it will mean you will render with one texture instead of needed 25 , or swap texture from harddrive to very gpu 25 times per frame to achieve the result. Like if you wanted to render a frame of doom 3 on a calculator.

 

You are rather confused on how to handle insifficient conditions of a station a program runs over, but remember, no matter what you learn, no program can overcome impossible.




#5164868 Trouble with quaternions / euler angles (3D) and player rotations

Posted by JohnnyCode on 05 July 2014 - 07:01 AM

 

. If he looks 45 degree downwards, he's supposed to move at half the speed, but no downwards force should be applied, so the direction vector should stay the same.

If direction vector differs, but you still wish to keep (forwardDirection I believe) corespond to the pseudo direction of the looking vector but remain in a plane , you may grab the x and y components of look vector and set z to 0 and normalize this vector- this will keep the direction refer to look at vector but remain in x,y plane (or pick some other plane of the three).

 

To your first question:

 

90 degree up and down (Can't look further than straight down / up)

you wish to avoid gimbal lock. You may peform dot product of viewOrientation and upDirection vectors, if the absolute value of this dot product is too close to 1.0, stop applying the desired rotation to it (stuck it simply). Be aware though that if a very large rotation request comes, you may end up with smaller dot product but already on the opposite side, resulting in incorrect cross product of those two and bringing gimbal lock for view matrix - you may over come this by applying rather constant or enough small step in rotation requests.

 

More robust solution is rather less efective but always accurate to determine gimbal event.

C=normalize( viewdirection cross upvector)

D=normalize ( C cross viewdirection)

then if dot(D,upvector) is negative (or positive) view direction has crossed the up vector




#5162668 Is this multiplication formula in linear algebra true?

Posted by JohnnyCode on 24 June 2014 - 05:56 PM

The problem is you are using the vector p as a matrix and transposing it as you see fit and not checking that the multiplication is even defined.

Yes, I was believing that if multiplication order shifts, then the dimensions of a vector matrix shift, but dimensions of other matricies do not.

But that is not possible since xT=!=x. What I find strange though (for example, dot product of x and xT is defined, thus their subtraction is defined, but thus subtraction of x and xT can never be a zero vector)

 

Though this modification is performed in HLSL GLSL operations, it is not linear algebra mathematical theory so I was wrong.




#5162637 Is this multiplication formula in linear algebra true?

Posted by JohnnyCode on 24 June 2014 - 02:27 PM

If you claim that Transpose(A*B) = B * A, you just proved every square matrix is equal to its transpose, by letting either A or B be the identity.

you mean, (A*I)T=I*A      <=>       AT= A 

 

 

square matrix is equal to its transpose if vector matricies get premultiplied. This cannot be performed in linear algebra beocuse of m x k * k x n?

I think you were right then, that it holds for OpenGL only for not distunguishing row column vectors. ANd I have spoted also a mistake in the claim you quoted




#5162565 Is this multiplication formula in linear algebra true?

Posted by JohnnyCode on 24 June 2014 - 10:44 AM

There is a thread in which is an equation formula I believe is not true. I am very concerned (sure) it is not true and I would like to get oponing to prove me it is equal.

 

Thanks, origiinal thread is here but you do not need to look at it (just for curiosity) http://www.gamedev.net/topic/657986-why-does-this-matrix-multiplication-order-matter/

 

I will begin:

 

It stemed originaly from formula

projection * (view * (model * position))=projection * view * model * position

 

the projection is a vector of 4 dimension and rest are matrices of 4x4 dimension.

 

I have narrowed it to

P*(V*(M*p))=P*V*M*p; where p is a vector matrix and P V M are multiplyable matricies

 

Now, I provide a proof that I will just copy paste here without modifications since it is very suficient

 

 

 claim: P*V*M*p=P*(V*(M*p)) where p is a vector (a matrix of [x,1] / [1,x] dimensions) and P,V,M are mutiplyable matricies

 

a helping true algebraic statement:

P*V*M*p=p*M*V*P  (becouse P*V*M=(M*V*P) T)

 

I will now show that the claim negate the true statement if the claim is to be true:

 

P*V*M*p=P*(V*(M*p)) => P*(V*(M*p))=((p*M)*V)*P

 

do you agree with P*(V*(M*p))=((p*M)*V)*P ? I just used associativity in the helping true statement, but it yeilds

 

P*V*(M*p)=(p*M)*V*P       /*P-1*V-1

 

M*p=p*M  transposed result

 

the claim would be right if p was not present, it would yield M=M

 

So the conclusion is that P*(V*(M*p)) equals to p*P*V*M and not to P*V*M*p

 

in words a column vector time M time V time P equals to row vector time transpose(M time V time P)

 

thus

P*(V*(M*p)) = p*P*V*M

and this means

P*(V*(M*p)) =!= P*V*M*p

 

The following oponing I got I think is not negating any of my proof and I would like to show why

 

How is that even supposed to work? A matrix multiplication M1 * M2 is only defined if M1 is a (n x k) matrix and M2 is a (k x m) matrix. The result is then a (n x m) matrix. One side effect of this is that you can transpose M, V and P but the only place the vector (a (4 x 1) matrix) can be is at the right-most side. You could multiply it from the left as a row-vector p^T (a (1 x 4) matrix) but then you would have to test a row and column vector for equality, which just does not work.

yes it results in a n x m matrix, the reason that vector 1 x n inverses its majoring to  n x 1 is becouse the n x m matrix transposes to m x n. Becouse m x n * n x 1 = m x 1 equals to(?!) 1 x n * n x k * k x m= 1 x n* n x m = 1 x m. Is not the situation there

 

I would cite now "but then you would have to test a row and column vector for equality, which just does not work.".  I am comparing vectors of the same majoring (dimensions).

 

And I think the following oponing will help

 

 

(P*V*M*p)T=pT*(P*V*M)T

 notice your equations were missing the transpose bit that makes them true

 

The upper formula is true, while, this formula is as well

(X*p)T=p*X

 I think so becouse the following is true about the formula

 

(1 x n * n x k )T = k x n * n x 1   (oponable point) [Edit] Succesfully oponed, I am now aware that vectors cannot be examined for equality if they have different dimensions (though only order of those)

 

I will here bring the rule of matrix multiplications in case of conflict with why are the X and p matricies transposed and of oposite order, just becouse they changed order within multiply operator

 

I will enforce the oponable point by following true statement in linear algebra that equivalents (not just imply) my (oponable point)

 

f5dc1798baf936a9b258bf26ab5b08e6.png

(AB)T = BT AT = B A

this is true becouse if we take right equation to not equal with left one, then (BTAT)T =A B =!= ((AB)T)T

[EDIT] upper is nonsense steming from fact that a vector cannot be "premultiplied" (see nxk * kxm required condition to multiply matrix). while me thinking it can becaouse of  v*A=AT*v formula accepting  (which does not hold at all in mathematics).

 

That is why I rewrote

(X*p)T=p*X

to

(1 x n * n x k )T = k x n * n x 1

becouse if it was (1 x n * n x k )T =  n x k * 1 x n  (only order changed, not pose) then

(X*p)T=pT*XT =!=p*X, what is true, would be (1 x n * n x k )T = k x n * n x 1 =!= n x k * 1 x n

 

that is why I have compared the matricies with same dimensions with only thanks to mul operation switch, without keepin the transpose relation, if I kept the tranpose relation, yes I would still compare matricies of same dimension.

 

thus by all this, to not fall for unrelation of AT BT = B A  we can about the original formulas write

(P*V*M*p)T=pT*(P*V*M)T=p*(P*V*M) =!= (M*V*P)*p=P*(V*(M*p)));

 

becouse that would mean that

(AB)T = AT B

 

 

Conclusion is I believe I am compraing the same dimensional matricies in original proof, and also that the formulas are not true from purely mathematical definition of multiply operation between matricies and the T relation to it, which carries an exclusive point to relativly each other




#5162511 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 24 June 2014 - 06:06 AM

 

JohnnyCode, it's not that people are angry at you specifically, it's just that what you are saying is factually wrong. Matrix multiplication (and that includes vector multiplication because vectors are also matrices) is associative. In other words:

 

projection * (view * (model * position))

 

is the same as

 

projection * view * model * position

 

and is the same as

 

((projection * view) * model) * position

 

I perform  a proof why it is not so and why it does not equal.

You see, I will not admit  I am wrong becouse I am not, and all your false statements trying to negate me are false, or right thus does not negate me.

So the OP question in the very title of topic is "

 

"Why does this multiplication order matter?"

 

concretly Proj*View*Mod*pos=!=Proj*(View*(Mod*pos))

 

I will not go deeper to OP inability to post results of following the advices in this topic, and going off topic with some mocking sparkling expert posting "dont prove me I am wrong fool" pictures

 

The proof now:

 

 claim: P*V*M*p=P*(V*(M*p)) where p is a vector (a matrix of [x,1] / [1,x] dimensions) and P,V,M are mutiplyable matricies

 

a helping true algebraic statement:

P*V*M*p=p*M*V*P  (becouse P*V*M=(M*V*P) T)

 

I will now show that the claim negate the true statement if the claim is to be true:

 

P*V*M*p=P*(V*(M*p)) => P*(V*(M*p))=((p*M)*V)*P

 

do you agree with P*(V*(M*p))=((p*M)*V)*P ? I just used associativity in the helping true statement, but it yeilds

 

P*V*(M*p)=(p*M)*V*P       /*P-1*V-1

 

M*p=p*M  transposed result

 

the claim would be right if p was not present, it would yield M=M

 

So the conclusion is that P*(V*(M*p)) equals to p*P*V*M and not to P*V*M*p

 

in words a column vector time M time V time P equals to row vector time transpose(M time V time P)

 

thus

P*(V*(M*p)) = p*P*V*M

and this means

P*(V*(M*p)) =!= P*V*M*p




#5162415 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 23 June 2014 - 03:49 PM

 

Either way, though, projection * view * model * position should be equal to projection * (view * (model * position)), because (as has been stated many times in this thread by everyone except JohnnyCode) matrix multiplication is associative.

 

I am stating from beginning of topic that the two formulas does not equal but you think they should becouse matrix multiplication is associative and vector is a matrix. By this you support your statement saying I am false. All I have written is totaly true and right

 

It got to the point you are telling me that I was not saying that matrix multiplication is associative as everyone was (like if I didn't know that), becouse I apointed that second formula tranposes the operation for the OP, and that the formulas does not equal.

 

There are so many posts of not only yours full of bolocks now that I refuse to deal with this anymore.

 

 

Yes it does, or, to be more to the point:
projection * (view * (model * position)) = ((projection * view) * model) * position

 

 

The vector transformation IS a matrix multiplication. As Bacterius said, associativity holds for all sizes,

 

Matrix multiplication is associative. For any three matrices A, B, C,

 




#5162397 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 23 June 2014 - 02:11 PM

 

Yes it does, or, to be more to the point:
projection * (view * (model * position)) = ((projection * view) * model) * position

 

Nonsense.

 

 

D is r x s which is 4 x 1 (4 rows, 1 column)

 

 

you just picked it to be row vector,

 

 

I have no idea how you got there, maybe you are confusing it with this identity?

 

It rather seems you are confused.

 

 

 




#5162363 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 23 June 2014 - 11:28 AM

It is in reverse order.

I know that transforming a vector is a matrix multiplication. but vector is also a 1 dimensional matrix so I prefer to call it a vector becouse it yelds certain characteristics than non-1dimensional vectors(matricies) do not have.

 

gl_Position = projection * (view * (model * position));

 

does not equal this

 

gl_Position = projection * view * model * position;

 

To see further, I checked wiki and it says

 

 

If four matrices A, B, C, and D are respectively m × p, p × q, q × r, and r × s matrices,

 

What does not hold for the first  formula. (this is simply the result of vector termin being an inclusion of matrix termin, what makes people think that what is a matrix must be associative just out of the box)

 

It accidentaly confirms the formula in my previous post, concretely

 

 

gl_Position = position * (projection * view * model);

 

is the same result as in the first formula.

so if OP used this formula (equal to his first one), he could change brackets how ever he thinks and it would provide the same result all the time.




#5162125 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 22 June 2014 - 10:21 AM

The difference in the order is whether to multiply the vector first, and have all the other matrixes multiply a vector (reducing the number of operations since a vector is only 4x1), or multiply all the matrixes in order and only multiply the vector at the end.

 

yes, first formula is more effective since you transform vector 3 times by a matrix, while second formula performs 2 matrix multiplications and than transforms a vector. I stress again that second formula performs reverse order of transformations, and it results in the same thing since matricies are (diagnosticly) transposed.




#5162110 Why does this matrix multiplication order matter?

Posted by JohnnyCode on 22 June 2014 - 09:12 AM

No, this works with all my other shaders.

 

What no? Do you mean shaders on linux that use the first formula work, and only this shader demands second formula on the linux?

 

Again, GLSL does not make distinction betweeen column or row vectors in its very code, but order of operations is explicit of course (order is actualy equivalent of majoring). you would better use glUniformMatrix4fv with transpose parameter specified, this will interpet matrix in GLSL code as expected, if driver is not totaly mad.

 

 

color.xyz * stexel.xyz

this is a cross product, depends on majoring as well.

 

I myself am not constructing matricies in GLSL code by implicit constructors, but I use explicit more atomic operations to actualy transform vectors by them, safely. (since I do not use glUniformMatrix4fv call to set matricies, but a batched vec4 array where I put everything I need for the shader in one call).

All operations that result in a vector not scalar I perform myself explicitly atomic for they are sensitive for majoring, to make myself sure.(this includes transformation of vector, multiplying matricies, crossing vectors...).




#5162062 Estimate curvature based on a triangle mesh

Posted by JohnnyCode on 22 June 2014 - 06:05 AM

smooth normals define actual unpresent derivated "smooth" surface of a tri geometry. You can use the 3 smooth normals of a triangle and compare them to the face normals of the triangle (face normals of a triangle are all equal for the three verticies of it). This will express the unpresent curved surface over the triangle. You can derive the surface from this information, to the resolution you wish.






PARTNERS