PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Managed DirectX9: Vector4?


Elemental
2004-02-29, 14:28:22
Hab mir jetzt mal ein buch über Direct X 9 gekauft und gerade malzu lesen angefangen. Was ich allerdings nicht verstehe, ist, was ein Vector4 ist. x,y,z is klar, aber was ist die 4. Komponente? Im Buch steht da nur:
rhw member: reciprocal of homogenous w

Was soll denn da sein???


mfG
Elemental

Demirug
2004-02-29, 14:37:58
Schau dir mal das an: http://developer.nvidia.com/object/understanding_w.html

beta3
2004-02-29, 14:39:00
hier von der doku auf msdn

http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx/s/vector4/vector4.asp

Vector4 Structure

--------------------------------------------------------------------------------

Note: This documentation is preliminary and is subject to change.
Describes a vector in four-dimensional (4-D) space.

Definition

Visual Basic .NET Public Structure Vector4
C# public struct Vector4
Managed C++ public __value struct Vector4
JScript .NET In JScript .NET, you can use structures, but you cannot define your own.

Members Table

The following table lists the members exposed by the object. Click a tab on the left to choose the type of member you want to view.

Fields

Show:
Fields
Methods
Properties
Field Description
W Retrieves or sets the w component of a 4-D vector.
X Retrieves or sets the x component of a 4-D vector.
Y Retrieves or sets the y component of a 4-D vector.
Z Retrieves or sets the z component of a 4-D vector.




Fields

Methods

Method Description
Add Adds two 4-D vectors.
BaryCentric Returns a point in barycentric coordinates, using the specified 4-D vectors.
CatmullRom Performs a Catmull-Rom interpolation using specified 4-D vectors.
Cross Determines the cross product in four dimensions.
Dot Determines the dot product of two 4-D vectors.
Equals Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Returns the hash code for the current instance.
Hermite Performs a Hermite spline interpolation using the specified 4-D vectors.
Length Returns the length of a 4-D vector.
LengthSq Returns the square of the length of a 4-D vector.
Lerp Performs a linear interpolation between two 4-D vectors.
Maximize Returns a 4-D vector that is made up of the largest components of two 4-D vectors.
Minimize Returns a 4-D vector that is made up of the smallest components of two 4-D vectors.
Multiply Multiplies a 4-D vector by a Single value.
Normalize Returns the normalized version of a 4-D vector.
op_Addition Adds two vectors.
op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
op_Multiply Determines the product of a Single value and a 4-D vector.
op_Subtraction Subtracts two 4-D vectors.
op_UnaryNegation Negates the vector.
Scale Scales a 4-D vector.
Subtract Subtracts two 4-D vectors.
ToString Obtains a string representation of the current instance.
Transform Transforms a 4-D vector or an array of 4-D vectors by a given matrix.
Vector4 Initializes a new instance of the class.

Properties

Property Description
Empty Returns an empty 4-D vector.

Structure Information

Namespace Microsoft.DirectX
Assembly Microsoft.DirectX (Microsoft.DirectX.dll)
Strong Name Microsoft.DirectX, Version=1.0.1901.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35


es beschreibt also einen 4dim. Raum, 2 ist die 4. achse
in echt gibt es auch eine 4.raumdimension (ob sie schon wissenschaftl. bewiesen wurde, weiss ich ned)

du hast das buch von tom miller, hab ich auch, aber bei dem satz kenn ich mich auch nicht aus


p.s:
die online doku ist viel besser als die, die mit dx9sdk summer update mitgeliefert wird, weil es vor ein paar wochen ein update für die doku gab
aber leider ist sie nicht downloadbar


edit:
da wir schon bei MDX sind, ich hab auch ein paar fragen
was ist ein "Plane" und wozu wird es verwendet
was ist ein Quaternion und wozu wird das verwendet

sry, aber das verstehe ich nicht bei der online doku

Elemental
2004-02-29, 14:48:26
OK, danke. Die MSDN erkärt aber auch nicht besonders viel. Da is der NVidia link schon besser. :)

P.S.: Ja, hab das Buch von Tom Miller :D

Lord Nikon
2004-02-29, 15:36:00
<off-topic> Gibt es ein gutes Online Tutorial für Managed DX 9.0 mit c#? </off-topic>

AHF
2004-02-29, 16:14:19
das ist die darstellung in homogenen koordinaten. die vierte koordinate gibt an, ob es sich um einen punkt oder richtungsvektor handelt (habe ich zumindest so in erinnerung)

marco42
2004-03-02, 01:24:44
Original geschrieben von Elemental
Hab mir jetzt mal ein buch über Direct X 9 gekauft und gerade malzu lesen angefangen. Was ich allerdings nicht verstehe, ist, was ein Vector4 ist. x,y,z is klar, aber was ist die 4. Komponente? Im Buch steht da nur:
rhw member: reciprocal of homogenous w

Was soll denn da sein???


mfG
Elemental
Eine gute Ergaenzung zu deinem Buch waere vielleicht
RealTime Rendering (http://www.amazon.de/exec/obidos/ASIN/1568811829/qid=1078186921/sr=2-1/ref=sr_aps_prod_1_1/028-7889756-1242908). Dort werden sehr viele Techniken erklaert.

Trap
2004-03-02, 15:51:36
Quaternionen sind einfach zu erklären: So wie komplexe Zahlen Drehskalierungen in der Zahlenebene sind, sind Quaternionen Drehskalierungen in 3 Dimensionen.

Homogene Koordinaten: Man benutzt eine zusätzliche Dimension um sich das Rechnen zu erleichtern.