Podobne
- Strona startowa
- PHP and MySQL MySQL Bible
- McGraw.Hill,.Digital.Animation.Bible.Creating.Professional.Animation.with.3ds.Max.Lightwave.and.Maya.(2004).LiB
- (ebook pdf) Teach Yourself SQL in 21 Days
- Linux. .Mandrake.10.Podręcznik.Użytkownika.[eBook.PL] (3)
- (ebook PDF Philosophy) Russell, Bertrand Political Ideals
- (eBook) James, William The Principles of Psychology Vol. I
- (business ebook) Internet Marketing Tips for Newbie
- Arturo Perez Reverte Las Aventuras Del Capitan Alatriste 5 Libros
- John Irving Zanim Cię znajdę
- Crichton Michael Linia Czasu (2)
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- prymasek.xlx.pl
Cytat
Do celu tam się wysiada. Lec Stanisław Jerzy (pierw. de Tusch-Letz, 1909-1966)
A bogowie grają w kości i nie pytają wcale czy chcesz przyłączyć się do gry (. . . ) Bogowie kpią sobie z twojego poukładanego życia (. . . ) nie przejmują się zbytnio ani naszymi planami na przyszłość ani oczekiwaniami. Gdzieś we wszechświecie rzucają kości i przypadkiem wypada twoja kolej. I odtąd zwyciężyć lub przegrać - to tylko kwestia szczęścia. Borys Pasternak
Idąc po kurzych jajach nie podskakuj. Przysłowie szkockie
I Herkules nie poradzi przeciwko wielu.
Dialog półinteligentów równa się monologowi ćwierćinteligenta. Stanisław Jerzy Lec (pierw. de Tusch - Letz, 1909-1966)
[ Pobierz całość w formacie PDF ]
.The function parameters include the reference frames and two vector structures thatare filled with the z-axis and y-axis values that define the frame's orientation.DirectX 6 added several axes-related functions to the frame-level API.The SetAxes() function isused to set the vectors that defined a coordinate space by which the SetOrientation() vectorsare transformed.The method is used mainly to support left- and right-handed coordinate systems,and to specify that the front of an object is represented on the negative z-axis.A related methodnamed GetAxes() retrieves the current frame axes.A pair of methods, namedSetInheritAxes() and GetInheritAxes() respectively, allow setting and retrieving aboolean value that is TRUE if a frame inherits its axes from its parent frame, and FALSEotherwise.A frame's position is the location of its origin in relation to the origin of another frame.When a childframe is created, its origin is placed at the origin of the parent frame.The SetPosition()function of IDirect3DRMFrame3 enables you to change the relative position of a frame.Thefunction has the following general form:HRESULT SetPosition(LPDIRECT3DRMFRAME3 lpRef, // 1D3DVALUE rvX, // 2D3DVALUE rvY, // 3D3DVALUE rvZ // 4);The function's first parameter is the address of a variable that represents the Direct3DRMFrameobject to be used as the reference.If this parameter is NULL, the method uses the scene frame asa reference.The second, third, and fourth parameters define the new position for the frame withinthe coordinate system of the frame of reference specified in the first parameter.The functionreturns D3DRM_OK if it succeeds, or an error otherwise.The following code fragment calls the SetPosition() function to move the position of the frame-5 units along the z-axis of the scene.LPDIRECT3DRMFRAME3 aCamera;LPDIRECT3DRMFRAME3 aScene;if (FAILED(camera->SetPosition(scene,D3DVAL(0), // xD3DVAL(0), // y-D3DVAL(5))) // z{// Frame repositioning error handler goes here}A related function called LookAt() is used to orient a frame so that its positive z-axis points in thedirection of another frame.This function is often used to orient a light or viewport to point in thedirection of another frame.The function's general form is as follows:HRESULT LookAt(LPDIRECT3DRMFRAME3 lpTarget, // 1LPDIRECT3DRMFRAME3 lpRef, // 2D3DRMFRAMECONSTRAINT rfcConstraint // 3);The function's first parameter is the address of the variable that represents the Direct3DRMFrameobject to be used as the target.This is the object that the func-tion looks at.The second parameteris the address of the variable that represents the Direct3DRMFrame object to be used as thereference.If this object is NULL, then the scene is used.The third parameter specifies a memberof the D3DRMFRAME_CONSTRAINT enumerated type that defined one axis of rotation to constrain.The enumaration is defined as follows:typedef enum _D3DRMFRAMECONSTRAINT {D3DRMCONSTRAIN_Z, // Do not use z-rotationsD3DRMCONSTRAIN_Y, // Do not use y-rotationsD3DRMCONSTRAIN_X // Do not use x-rotations} D3DRMFRAMECONSTRAINT;The LookAt() function returns D3DRM_OK if it succeeds, or an error otherwise.Frame movement controlsRetained mode provides a rather elaborate set of related functions that are used to scale, rotate,and translate frames.The functions can be roughly classified into two groups: those that produce a single modificationon the frame's matrix, and those that produce a continuous series of modifications.The functionsin the second group are often used in producing simple animations at the frame level.Frame-level animations are easy to set up and are often of sufficient quality to produce satisfactoryresults when implementing simple movements.You can use two functions of theIDirect3DRMFrame3 interface to provide simple rotation and translation of a frame:SetRotation() and SetVelocity().In either case the movement is produced by a call to theMove() function, of IDirect3DRMFrame3, or the Tick() function, of IDirect3DRM3.Tick()was discussed in Chapter 16.The actions of the SetRotation() and SetVelocity() functionscan be combined to produce interesting effects.The AddRotation() function is used to set a frame rotating along one or more of its axes, by agiven angle.The function has the following general form:HRESULT SetRotation(LPDIRECT3DRMFRAME3 lpRef, // 1D3DVALUE rvX, // 2D3DVALUE rvY, // 3D3DVALUE rvZ, // 4D3DVALUE rvTheta // 5);The first parameter is the address of a variable that represents the Direct3DRM-Frame object to berotated.If this parameter is NULL, then the function uses the scene's frame.The second, third, andfourth parameters define the axis or axes along which the rotation is to take place.Valid values aredocumented to be in the range -1.0 to 1.It appears that any nonzero value selects thecorresponding axis, and a zero value deselects it.Positive values produce a clockwise rotation andnegative values rotate the frame in a counterclockwise direction.Numeric varia-tions appear tohave no effect in this function because the angle and speed of rotation are determined elsewhere.The fifth parameter is the rotation angle, in radians, for each iteration of the Tick() or Move()function previously mentioned.Both Tick() and Move() scale the rotation angle according to alocal parameter in these functions.SetRotation() returns D3DRM_OK if it is successful, or anerror otherwise.In our experiments with the SetRotate() function we detected some unexpected results.One ofthem is that if a zero value is entered for all three axes and a nonzero value for the angle ofrotation, the frame is set to rotate along the x-axis anyway.The only way in which we have beenable to call the SetRotate() function so that the frame remains stationary is by entering a zerovalue for the angle of rotation.In this case the value entered for the axes is meaningless.The SetVelocity() function selects the axis to which a linear movement is applied, determinesthe velocity of the linear movement for each axis, and deter-mines if the object's rotational velocityis taken into account when applying the linear movement.Notice that SetVelocity() refers to a linear translation along the axes.Also notice that it allowsdefining the velocity independently for each axes, whereas the SetRotation() function,described previously, does not
[ Pobierz całość w formacie PDF ]