Jump to content

  • Log In with Google      Sign In   
  • Create Account


Model world and effect file.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 lyzerk   Members   -  Reputation: 120

Like
0Likes
Like

Posted 29 August 2012 - 07:49 AM

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 :/

Sponsor:

#2 kauna   Crossbones+   -  Reputation: 2141

Like
0Likes
Like

Posted 29 August 2012 - 08:47 AM

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!

#3 CC Ricers   Members   -  Reputation: 623

Like
0Likes
Like

Posted 29 August 2012 - 08:53 AM

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.
My development blog: Electronic Meteor

#4 kauna   Crossbones+   -  Reputation: 2141

Like
0Likes
Like

Posted 29 August 2012 - 09:16 AM

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!

#5 CC Ricers   Members   -  Reputation: 623

Like
0Likes
Like

Posted 29 August 2012 - 10:19 AM


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.


Oh, I must have missed that those short statements were meant to be pseudo code.
My development blog: Electronic Meteor

#6 lyzerk   Members   -  Reputation: 120

Like
0Likes
Like

Posted 30 August 2012 - 09:25 AM

Thanks for answers. But now i have problem. here is link.

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS