Hi guys,
It's that annoying dude that always ask retarded questions again :P
I am wanting to get some ideas on how I can place my camera in the middle of my skyome.
My initial thought was to just grab the position of my camera and make that the same as my skydome... But I don't think that will work because my skydome is not the built-in mesh DirectX supplies (I made it my myself).
I don't know.
I have implemented a bit of code but its wrong.
Thanks guys... sorry if its a simple question :)
How to get my sky to be centre of world?
That's the thing... I don't actually have a position variable for my skydome.
I can add one (did think of that) but than I was thinking how about my geometry, I mean all the vertices that make up the skydome?
Do I have do also change them? Hmmm... do you know what I mean...
I can add one (did think of that) but than I was thinking how about my geometry, I mean all the vertices that make up the skydome?
Do I have do also change them? Hmmm... do you know what I mean...
I guess you need something like this:
D3DXVECTOR3 camPos = {...}, camTarget = {...}, camUp = {...}D3DXMATRIX skyWorld, camView, camProj;...D3DXMatrixIdentity(&skyWorld);skyWorld.xyz = camPos;...D3DXMatrixPerspectiveFovLH(&camProj, D3DXToRadian(45.0f), ScreenWidth / ScreenHeight, fNear, fFar);D3DXMatrixLookAtLH(&camView, &camPos, &camTarget, &camUp);...d3d->SetTransform(_VIEW, &camView);d3d->SetTransform(_PROJ, &camProj);....//then when rendering sky geometryd3d->SetTransform(_WORLD, &skyWorld);sky->DrawMe();...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement