Jump to content
  • Advertisement
Sign in to follow this  
lyzerk

Model world and effect file.

This topic is 2121 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,

I was working with XNA a couple month ago, there is was BasicEffect. With that basiceffect we can give place of model. But with c++ and directx 9.
I cant found any tutorial about that but i have found that

call it;
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );

after render model

call it;
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld2 );

after render model

and now i have 2 model on screen.

i can't understand that, its not logic for me. How can i do BasicEffect in c++ directx9 ?


Sorry for my english, im just trying for learn :/

Share this post


Link to post
Share on other sites
Advertisement
Well that is the way it works.

You set the transform matrix and then draw the model, which uses then the transform matrix. Logically, using 2 different matrices, your model will show at 2 different locations.

If I understand correctly, Basic Effect is a simple frame work which implements certain effect functionality.
I think that you may find a shader which implements most of the functionality here:

http://developer.amd.com/archive/gpusamples/fixedfuncshader/Pages/default.aspx

Cheers!

Share this post


Link to post
Share on other sites
The function calls you listed are not enough to render a second model. Your models are rendered through DrawIndexedPrimitives or similar other functions. Unless I read your message wrong and you are saying you are trying to render two models with different matrices assigned to them?

BasicEffect object helps abstract away most of the effect work to make it easier for beginners to do (plus on certain platforms you're just limited to using built-in effects). You can also work with custom effects in XNA, and there are enough tutorials such as this one to show you how. I would imagine it may be better to use XNA to understand how implementing your own effects work in general so the transition to using them in DX9 becomes easier.

Share this post


Link to post
Share on other sites

The function calls you listed are not enough to render a second model.


On the contrary. It is enough to just set another world matrix and call the required rendering functions. The given functions are rather pseudo of course.

However, I'm thinking that there is some ambiguity in the OPs message. I'm not sure whether he managed to draw something or not.

Cheers!

Share this post


Link to post
Share on other sites

[quote name='CC Ricers' timestamp='1346252038' post='4974448']
The function calls you listed are not enough to render a second model.


On the contrary. It is enough to just set another world matrix and call the required rendering functions. The given functions are rather pseudo of course.
[/quote]

Oh, I must have missed that those short statements were meant to be pseudo code.

Share this post


Link to post
Share on other sites
Thanks for answers. But now i have problem. here is link.

http://www.gamedev.net/topic/630488-terrain-texture-problem/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!