Jump to content
  • Advertisement
Sign in to follow this  
Mathy

[SlimDX] CustomVertex.TransformedTextured?

This topic is 2990 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

How can I create the equivalent of MDX's CustomVertex.TransformedTextured object in SlimDX? [Edited by - Mathy on March 17, 2010 10:51:07 AM]

Share this post


Link to post
Share on other sites
Advertisement
There is no such object in native D3D, so SlimDX doesn't have an equivalent. You need to create the structure manually, something like:

struct PretransformedVertex {
public Vector4 Position;
public Vector2 Texcoord;
}

Et cetera. The FVF values are represented by the VertexFormat enumeration in SlimDX, so you can use those to create the FVF for this vertex structure. There are examples of this process in the SDK samples (MiniTri, for example).

Share this post


Link to post
Share on other sites
That's not correct it seems.

The TransformedTextured class in MDX has 6 creation arguments.

As an example:

new CustomVertex.TransformedTextured(-0.5f, -0.5f, 0.0f, 1.0f,0.0f, 0.0f)

Whereas your class has none, and only 4 for the Vector class on it.

[Edited by - Mathy on March 17, 2010 10:50:17 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Mathy
That's not correct it seems.

The TransformedTextured class in MDX has 5 creation arguments.

As an example:

new CustomVertex.TransformedTextured(-0.5f, -0.5f, 0.0f, 1.0f,0.0f, 0.0f)

Whereas your class has none, and only 4 for the Vector class on it.


In case you can't count, you've listed six arguments in that constructor. Josh wasn't posting a complete drop-in replacement for the vertex type, just an example of how it could be done. Not being willing to add some of the niceties yourself is just pure laziness on your part.

Share this post


Link to post
Share on other sites
It's entirely correct, as that struct has no ctor.
If you want to have a ctor, add one or use a static member to construct one.

SlimDX is not MDX. Don't expect it to be.

Share this post


Link to post
Share on other sites
Or you can just use object initializers:

new PretransformedVertex()
{ Position = new Vector4(-0.5f,-0.5f,0.0f,1.0f)
, Texcoord = new Vector2(0.0f,0.0f)
};


The 6 arguments are equivalent to the 4+2 fields of the vectors.

Share this post


Link to post
Share on other sites
Wow wow wow wow. What's up with the hatred?

I am sorry I somehow pissed everyone off or made them mad.

Mike, that was a typo, and has been corrected now. Also, I didn't expect him to post anything different. I thought there was a difference. I am a beginner, and I didn't know that a TransformedTextured's ctor's last two arguments were for the texture coordinate positions.

Zao, I am not expecting MDX to be SlimDX. I'm simply just asking for help since MDX is what I am used to. Did I say any different?

MaulingMonkey, your help is perfect. Just what I needed. I now understand that the two last arguments are for the texture coordinates. Makes much more sense now. More rating for you!

Share this post


Link to post
Share on other sites
Quote:

Wow wow wow wow. What's up with the hatred?

Probably because of your attitude -- you can't really use the "I'm a beginner" defense if you're going to make accusations that the answers you receive on the topic are "not correct." Your presentation in that post also implies that you expected to get a complete solution without demonstrating what you've tried, which tends to put a lot of people off because it's insulting.

Share this post


Link to post
Share on other sites
There's a huge difference between "That's not correct", and "That's not correct it seems".

By saying "That's not correct it seems", I wasn't accusing anyone. I was simply saying that my results were inaccurate compared to the expectations I had.

Share this post


Link to post
Share on other sites
Quote:

There's a huge difference between "That's not correct", and "That's not correct it seems".

By saying "That's not correct it seems", I wasn't accusing anyone. I was simply saying that my results were inaccurate compared to the expectations I had.

Yes, but you should pick your words more carefully, because they are still open to interpretation. Especially given the brevity of most of your posts and the nature of your post history. You appear to be on the way to earning yourself the reputation of somebody who doesn't do their own research, who puts no thought into their work, and just comes here and asks questions expecting full and complete answers to be handed to them on a silver platter.

That's probably not what you're intending to do, but that's how you're being perceived.

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!