Noob at Direct3D

Started by
9 comments, last by The C modest god 20 years, 6 months ago
quote:Original post by The C modest god
quote:Original post by Nik02
It depends on the format of the vertices. If the rhw flag is set, then d3d doesn''t modify your vertices.

-Nik

it is set to D3DFVF_XYZRHW|D3DFVF_DIFFUSE.
Why would the rhw coordinate prevent from the world matrix to change the x, y, z coordinates?
As far as I understand the rhw coordinate is the surface color coordinate, or strength.


Rhw specifically tells d3d that you have transformed the vertex yourself, and d3d should send it to rasterization right away. No offense, but it does no good to guess, when you could see the sdk for precise info on this.

The w can be thought as inverse depth of a vertex mapped to 0...1 (usually) from the vertex''s perspective space depth.
This is done because it enables, for example, a z-buffer to operate at an uniform scale, and various other operations involving fog and texture coordinate perspective correction.

quote:
About the 4*4 world matrix, tell me if I am right...
The first 3 rows of the matrix are the axis(orientation and scaling) of the space represented by the matrix and the fourth row is the transformation of the space(origin point).
The fourth column has no role?


The fourth column contains the coefficients of the w component.
It is primarily/commonly used in perspective projection with some multiplier on z row to cause a perspective divide.
But, in a world matrix, i rarely have seen perspective divide used...

Also, fourth row is translation, not transformation. It defines object''s origin position.

Kind rgds,
-Nik

Niko Suni

This topic is closed to new replies.

Advertisement