|
|
Re: Almost Got View Entity's Transformation Matric
[Re: xXxGuitar511]
#143537
08/01/07 06:27
08/01/07 06:27
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
i tried to test with matWorldView replacing matWorldViewProj and the entity wasn't visible -- i think it lacked perspective translations (and probably needed outPos.xy/outPos.z or somethign) and was no longer within the bounds of the screen. i have 26 days to get my other project finished, with a portfolio of my development so i won't be able to fiddle too much for a while; however i think it's worth learning more about matrices  that would probably end up being quicker than all out trial and error  julz EDIT: ooooooooh yeh! that feels great i've got it. just make sure the second view's aspect is set after the camera's aspect (and make sure they are the same). that's all i needed to change from my last example. works like a charm pixel-perfect, invisible ball.
Last edited by JulzMighty; 08/01/07 10:10.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
fresh trouble -- normal and pan issues
[Re: JibbSmart]
#143538
08/02/07 10:43
08/02/07 10:43
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
i have an effect that distorts the view based on the dot product between the view and the normal of each pixel on the model. multiplying the offset by dot(InNormal,vecViewDir); works fantastically for this, but then when i change the model's pan i just run into trouble as the normal isn't getting rotated with the model. i though mul(InNormal,matWorld); would fix this, but it didn't. it sort of did, but the dot product doesn't seem to be a factor. i multiplied it to increase the result and found some weird distortions that seemed to depend on whether the camera's tilt was positive or negative.
basically it isn't working.
any suggestions on getting a normal into world space and then the dot product between that and the camera angle? it worked great without rotating the model, but i need it to rotate.
julz
PS: i know i said somewhere i wouldn't be on for a while, but this is really bugging me.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: fresh trouble -- normal and pan issues
[Re: JibbSmart]
#143539
08/03/07 17:20
08/03/07 17:20
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Hmmm... not sure without testing it (which I'm not in a position to do right now). A couple of ideas:
1) try inverting the normal (matWorldInv) 2) Adding the view angles (matWorldView[Inv]) 3) Use the dot product relative to the view:
VS: float3 wPos = mul(In.Pos, matWorld); float3 wNormal = mul(In.Normal, matWorld); float3 offset = normalize(vecViewPos - wPos); [float3] Out.Light = dot(wNormal, offset);
xXxGuitar511 - Programmer
|
|
|
Re: fresh trouble -- normal and pan issues
[Re: xXxGuitar511]
#143540
08/03/07 23:32
08/03/07 23:32
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
thanks for the ideas  suggestion 3 sounds like my best bet. the thing is, it isn't too different from simply multiplying the normal by matWorld and using vecViewDir (except your way will give nicer results as they depend on view position and not angle). my way with the matWorld multiplication did work fine until i tilted the camera up or down and had heaps of trouble. anyway, i'll give these a go and post again later, but i have lots of work to do today. thanks  julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|