Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SirBlackKnight

3d scaling serious problem

This topic is 5652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Guys, I''m havin'' some serious problems with scaling Direct3D views (it''s more a theoretical problem, than practical). I''m writing an editor which uses multiple viewports in Direct3D. There must be a posibility of scaling these views (top, left, front and max-style perspective view). To do this I''m using direct3D world matrix (worldMat = moveToScalePointMatrix * scaleMatrix * moveBackFromScalePointMatrix). Everything works gr8 but those lights, wrrr!!! They remain in their positions while my objects are changing size (and sometimes position during scaling). I''ve tried to scale light''s position and intensity manually, but I got strange flashes on the lighted objects (lights intensity is not changing smoothly during scaling, besidesm I don''t think it''s a good idea...). Anyone can help me with this problem? Regards, - BlackKnight

Share this post


Link to post
Share on other sites
Advertisement
I don''t understand what you''re trying to do. You want to make the objects bigger but make the lights move away too? Why not move the camera closer?

If you scale the object and the light pos (but leave the intensity the same) the result should look the same unless you have falloff. If you have falloff, you need to change that but you should not need to change the intensity.

Any reason why you can use direct/parallel lights? (not spotlights or point lights)

Mark
Bytten Independent Games Magazine
http://www.bytten.com

Share this post


Link to post
Share on other sites
Hi,

I need to perform scaling a view (like in 3dsmax - perspective view scaling). Camera MUST NOT change its position (so lookFrom and lookAt vector must remain unchanged during scaling).

To do this I need to scale viewMatrix. While scaling viewMatrix objects in a 3D-scene change their size (and position), but Direct3D lights remain in their position - that couses wrong lighting. I''ve tried to change lights positions manually (according to my scaling matrix), but still got wrong lighting....

- BlackKnight

Share this post


Link to post
Share on other sites
If I follow what you are trying to do, you need to adjust your projection matrix to zoom in/out. You do this by passing in a smaller/larger fov angle to the dxutil perspective matrix functions.

Then just set the correct projection matrix before drawing each view.

The lights should be ok, since you are not scaling the world as you are currently doing.


Hope this helps.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!