dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Vertexa koordinaatas kameras koordinaataas

 
dev.gamez.lv Forum Index -> Microsoft DirectX
View previous topic :: View next topic  
Author Message
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Apr 15, 2006 6:52 pm    Post subject: Vertexa koordinaatas kameras koordinaataas

Kaarteejo reizi jautaajums nav specifisks DirectX.
Man vajadzeetu paarreekjinaat vertexa koordinaatas kameras koordinaataas.Tas man vajadziigs prieksh vertex fog.
Te buus kods:
Code:

add r1.x, -c0.z, c4.z
mul r1.x, r1.x, c4.w
max r1.x, r1.x, c4.x
min oFog, r1.x, c4.y

c4={0.0,1.0,fFogEnd,1.0/(fFogEnd-fFogStart)}
c0=vertexa koordinaatas kameras koordinaataas.

Visu google paarmekleeju kameer atradu shito kodu,nerunaajot jau par kaadu paskaidrojumu.

P.S. Varbuut kaads var iedot kaadu citu kodu prieksh vertex fog ar vertex shaderiem?
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
elvman
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 09 Apr 2003
Posts: 1278
Location: Kuldiga

PostPosted: Sat Apr 15, 2006 8:05 pm    Post subject:

Sanaak kaarteejais monologs,bet izsecinaaju atbildi:

Ja c0-c3 ir WorldViewProjection matrix,tad c3 atbild par poziiciju.
Liidz ar to ar dot produktu:
dp4 r0, v0, c3
ieguustam distanci starp kameru un vertexu (r0=distance).

Paldies par uzmanibu!
_________________
long time; /* know C */
Back to top
View user's profile Visit poster's website
Display posts from previous:   
dev.gamez.lv Forum Index -> Microsoft DirectX All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group