|
delphi-3d-digest Saturday, July 19 1997 Volume 01 : Number 008
---------------------------------------------------------------------- Date: Thu, 17 Jul 1997 11:02:22 -0400 From: "Gerald A. Ebert" <GAEbert@IName.Com> Subject: [delphi-3d] opengl.dcu in Delphi 3 I was at the Borland Conference earlier this week and thanked Charles Calvert for shipping the opengl.dcu file with Delphi 3. He told me that Danny Thorpe was the one who put it in. On the back cover of his book, "Delphi Component Design", it says he is a R&D engineer on Borland's Delphi development team. - -------- ------------------------------ Date: Fri, 18 Jul 1997 01:42:17 +0200 From: McBain <zastrow@cs.tu-berlin.de> Subject: [delphi-3d] need Help with Direct3D-IM Mode This is a multi-part message in MIME format. - --------------70CB4D492FC2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi folks ! I have just started with programming D3D-IM, and so i have a few questions. 1) I don't understand why the VIEW, PROJECT and WORLD matrizes exits ! Or better, how belong them together ? 2) I tried to programm a translation(tx, ty, tz) with following matrix: ( 1 0 0 tx ) ( 0 1 0 ty ) ( 0 0 1 tz ) ( 0 0 0 1 ) i multiplied this maxtrix with the WORLD one, but only the translation in the z-direction worked. But if i try to change the tx or ty value some strange things happened to the scene ! Next, i tried a rotation. And with this matrix i got perfect results ! Rotate z ( cos(a) -sin(a) 0 0 ) ( sin(a) cos(y) 0 0 ) ( 0 0 1 0 ) ( 0 0 0 1 ) I hope someone can explain me the secrets of the 3 standard matrizes. 3) Ok, and the last questions is about clipping in the viewport. My test-example are a few triangles in a plane. I scaled the plane until it is bigger than the viewport, and must be clipped ! But if an edge of the triangles hits the border of the viewport, it won't be clipped but stayes at the border ! This error is displayed in the picture which is attached !
Ok, thanks to everyone who can help me PS: I do programming in Delphi 2.0 with the DirectX-Header files from BStone, which have a lot of errors in D3D-RM declarations. But i think in IM nothing can be wrong with the header files. Or not ? ------------------------------ Date: Fri, 18 Jul 1997 11:15:46 +0300 (EET DST) From: Patrick Mikael Aalto <ap@co.jyu.fi> Subject: [delphi-3d] Newbie here, with a Direct3D RM question Hi! I just yesterday joined this Delphi3D list, and already I have a question. But first, perhaps I should sort of introduce myself. I have been programming with Delphi for about 5 months now, and with Direct3D just a few weeks. I've been programming 3D games for almost 10 years, though. My first major project was LineWars, back in 1988, coded with Turbo Pascal and Assembler. The sequel, LineWars II, was finished in 1994, it was coded in pure assembly language. Both are 3D space shoot-em-ups with multiplayer support. And now I am learning DirectX/Direct3D programming with Delphi, which will hopefully lead to LineWars III in the future. I am using Blake Stone's Delphi headers, and Retained Mode, at least for now. Well, my question (which hopefully is not a FAQ, my FTP client timed out every time when I tried to connect to the archive site): What is the best way to create a starfield? That is, a number (a few hundred) of faraway stars, rendered as single pixels, behind everything else rendered on the screen. I want my program to work both in any fullscreen mode and in a window. In a fullscreen mode I was able to GetDC and draw a few pixels onto the BackBuffer before calling Tick(), but how do I do this in a window? How do I get a pointer into the offscreen buffer that Direct3D blits to the screen when I call Update()? I wonder if I am doing something weird in my program, I have been copying from a couple of examples, one for windowed mode and one for a fullscreen mode, and they seem to be using rather different approaches. For example, in a fullscreen render loop I have: DXCheck( FView.Clear ); DXCheck( FD3DRM.Tick( lMoveVal ) ); DXCheck( FFrontBuffer.Flip( nil, DDFLIP_WAIT )); while in the windowed mode the renderloop does this: DXCheck( FScene.Move( lMoveVal )); DXCheck( FView.Clear ); DXCheck( FView.Render( FScene ) ); DXCheck( FDev.Update ); That was the only way I got it working, but I still think they are more different than they perhaps should be. Any help would be appreciated, I hope I did not spend too much of your time. Thanks! Patrick Aalto ap@co.jyu.fi http://www.co.jyu.fi/~ap
- -------- ------------------------------ Date: Sat, 19 Jul 1997 14:08:57 -0400 (EDT) From: "Jodi J. Showers" <jodi@DMachine.com> Subject: [delphi-3d] LoadTextureFromResource Desperation Having problems loading a texture from a dll resource. I'm a LITTLE desperate, since we are going to beta in 't minus 5' days, and we don't want our resources readily available.
LoadLibrary and FindResource are reporting success, but LoadTextureFromResource is reporting a D3DRMERR_BADFILE; and occassionaly an access violation.
The call back is callin-backin just fine. Loading the texture from disk using LoadTexture() works dandy.
The call definition looks ok function LoadTextureFromResource ( rs: HRSRC ; var lplpD3DRMTexture: IDirect3DRMTexture ): HRESULT ; virtual ; stdcall ; abstract ; versus microsoft STDMETHOD(LoadTextureFromResource) (THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
any ideas? Jodi.
- ---------------------------------------------------------------------------- - --------------------------- TextureInstance : THandle; Function GetTexture ( tex_name: PChar ; lpArg: Pointer ; var lpD3DRMTex: IDirect3DRMTexture ): HRESULT ; CDecl; var reshandle : HRSRC; TextureName : String; Begin { TextureName := ExtractFileName(String(tex_name)); TextureName := ExtractFilePath(Application.Exename) + 'Textures\' + TextureName; DXCheck(theWorld.FWindow.D3DRM.LoadTexture(Pchar(TextureName), lpD3DRMTex)); Result := D3DRM_OK;} TextureName := ChangeFileExt(ExtractFileName(String(tex_name)),''); ResHandle := FindResource(TextureInstance, PChar(TextureName), RT_BITMAP); if ResHandle <> 0 then Begin DXCheck(theWorld.FWindow.D3DRM.LoadTextureFromResource(ResHandle,lpD3DRM Tex)); Result := D3DRM_OK; End Else Begin ShowMessage(TextureName + ' Missing'); Result := D3DERR_TEXTURE_LOAD_FAILED; End; End; procedure TMainForm.FormCreate(Sender: TObject); var TextureLibrary : String; begin //Load up the textures TextureLibrary := 'Textures.dll'; TextureInstance := LoadLibrary(PChar(TextureLibrary)); if TextureInstance = 0 then Begin ShowMessage(TextureLibrary + ' not found'); Application.Terminate; end; End; Jodi J. Showers / Jodi@DMachine.com Technical Director, Partner Digital Machine Interactive Inc. Toronto, ON Canada [v] (416) 406-1162 [f] (416) 766-4796 [c] (416) 720-9981 - -------- ------------------------------ End of delphi-3d-digest V1 #8 ***************************** |