Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 683 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
View and Projection matrix with 2 views #154525
09/16/07 14:19
09/16/07 14:19
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
Hi!

Is there a way to get the View and Projection matrix of the camera view and also from another view at the same time/ in the same shader?
E.g.:
matView,matProj -> from view camera
and
matView2,matProj2 -> from view camera2

the manual tells only less information about
matView:
The view transformation 4x4 matrix, set by the view position and angles

does the matView matrix looks like this:

| x y z 0|
| x y z 0|
| x y z 0|
| pan tilt roll 0|

??

Re: View and Projection matrix with 2 views [Re: Chris3D] #154526
09/16/07 18:58
09/16/07 18:58
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
no reply?

ok, I just want to know how the matView and the matProj look like in Algorithm form...so which "array" gets the x,y and z vars and where are the euler angles in the matrix arrays?
Please help me...it could be profitable for you!

Re: View and Projection matrix with 2 views [Re: Chris3D] #154527
09/16/07 19:04
09/16/07 19:04
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Quote:


ok, I just want to know how the matView and the matProj look like in Algorithm form...so which "array" gets the x,y and z vars and where are the euler angles?




That is something I´d like to know as well...

I needed the worldviewprojection matrix. My solution is, to pass the product of view and projection matrix using matMtl from a materialevent to the shader and multiplicate it there with matWorld.

Re: View and Projection matrix with 2 views [Re: Slin] #154528
09/16/07 19:28
09/16/07 19:28
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
I know this method, too. The projection shader(wiki) uses this solution, but I found out, that the view matrix gets the values only from one view.
So, either matView gets the camera vars or the vars from another new view, but not both.
...
Well, when "matView" only changes in c-script and not in the shader, it could work...but I don't think so.

Maybe I have to use the directX sdk to get my PCS Shadow working...although I saw a solution without dll...It's a pity.
Hey great ShaderConvertions Slin, if I ever sell my AnimationStudio you get it for free

Edit:
Is matMtl the only matrix that I can edit(with c-script) and pass to the shader?

Last edited by Chris3D; 09/16/07 19:48.
Re: View and Projection matrix with 2 views [Re: Chris3D] #154529
09/17/07 01:31
09/17/07 01:31
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
i thought that the view matrix(es) calculated depending on which view the shader is shown in.... so technically you couldn't have 2 views doing this could you?


- aka Manslayer101
Re: View and Projection matrix with 2 views [Re: mpdeveloper_B] #154530
09/17/07 02:01
09/17/07 02:01
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Quote:

i thought that the view matrix(es) calculated depending on which view the shader is shown in.... so technically you couldn't have 2 views doing this could you?




Yes that's correct. To get a second view matrix you would need to create one in D3D.


Sphere Engine--the premier A6 graphics plugin.
Re: View and Projection matrix with 2 views [Re: Matt_Aufderheide] #154531
09/17/07 10:40
09/17/07 10:40
Joined: Sep 2003
Posts: 271
Germany
Chris3D Offline OP
Member
Chris3D  Offline OP
Member

Joined: Sep 2003
Posts: 271
Germany
ok, thanks for your answers...

...but I still like to know how the matView matrix Algorithm of 3dgs looks like, it must be different from the d3d one, because d3d doesn't use pan,tilt and roll.
Greetings Chris

Re: View and Projection matrix with 2 views [Re: Chris3D] #154532
09/17/07 13:59
09/17/07 13:59
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
well, you could create your own matrix and position it in c-script


- aka Manslayer101
Re: View and Projection matrix with 2 views [Re: Chris3D] #154533
09/17/07 19:58
09/17/07 19:58
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
D3D does use pan roll tilt, just called differently: yaw,pitch,roll

I dont think a view matrix however is simply what like your above example stated.




Sphere Engine--the premier A6 graphics plugin.
Re: View and Projection matrix with 2 views [Re: Matt_Aufderheide] #154534
09/18/07 12:10
09/18/07 12:10
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
i was under the impression trigonometry is involved. i think i recall a wikipedia article on transformation matrices, but i don't have time to have a look. it involved object--world--view--perspective or something like that step-by-step.

surely there's a D3D function that'll do it for you with a really tiny plugin?

julz


Formerly known as JulzMighty.
I made KarBOOM!

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