glVertex4f in D3D

Started by
7 comments, last by transcendent_one 16 years, 3 months ago
Hi, anyone knows how to specify homogeneous coordinate w using FVF? Like it is in OpenGL function glVertex4f.. thanks.
Advertisement

Hi,

you'll need to use the D3DFVF_XYZRHW to specify the 4d-vector containing the w-component.

Good luck!
If you're using FVF codes (rather than shaders), you can use D3DFVF_XYZW. If you're using shaders, you just put a 4D vector in your vertex declaration.

What are you trying to do, exactly?
Thanks for replies.

I require to render some rational surfaces, that require that fourth element in vertex description. So D3DFVF_XYZRHW or D3DFVF_XYZW is what I'm looking for?
I'm not sure I understand the documentation in MSDN about this stuff.. :/
I'm not sure what you mean by "rational surfaces", but if you're not using a vertex shader, D3DFVF_XYZW is the only way to pass 4D vectors to D3D. D3DFVF_XYZRHW means a point in post-transform space, which is probably not what you want.
Rational surface for example is NURBS.
Yea, I think D3DFVF_XYZW is what I'm looking for.

Thanks for help.. :)
Going a little off topic here; I didn't think D3D supported NURBS? You're not doing this in a shader are you?
Quote:Original post by Evil Steve
I didn't think D3D supported NURBS?
I forget the exact algorithm, but D3D did introduce support for HOS hardware in Direct3D 8 I think. Unfortunately stencil shadowing pretty much killed it.

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by Evil Steve
Going a little off topic here; I didn't think D3D supported NURBS? You're not doing this in a shader are you?


Actually I'm working on rational Bezier patches, I just gave the example of rational surface.
My project is more like scientific application, trying to use D3D instead of OpenGL (I guess thats a bit madness, because DX is more for gaming stuff). And yes, no shaders here :)

This topic is closed to new replies.

Advertisement