Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
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
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

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
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

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 Offline
Expert
xXxGuitar511  Offline
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
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

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!
Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1