View previous topic :: View next topic |
Author |
Message |
losey DeleD PRO user
Joined: 25 Nov 2006 Posts: 35 Location: Hawaii
|
Posted: Tue Dec 19, 2006 1:41 am Post subject: order of objects in .x files |
|
|
Is there any way to alter the order in which the objects are presented in .X exports?
In a stock VB6 routine, if a large object like a surface on which islands appear is the last object in the .X file, the other objects (Islands) are overlaid in any overlap area regardless of their height and depth. Using a text editor to move all the .X code for this large object such that it is first in the .X file solves the problem, but is a chore for each new file. _________________ George Losey |
|
Back to top |
|
|
jwatte DeleD PRO user
Joined: 26 Apr 2006 Posts: 513
|
Posted: Tue Dec 19, 2006 4:29 am Post subject: Re: order of objects in .x files |
|
|
losey wrote: |
Is there any way to alter the order in which the objects are presented in .X exports?
In a stock VB6 routine, if a large object like a surface on which islands appear is the last object in the .X file, the other objects (Islands) are overlaid in any overlap area regardless of their height and depth. Using a text editor to move all the .X code for this large object such that it is first in the .X file solves the problem, but is a chore for each new file. |
Your problem is that you have not turned on Z buffering then rendering, or you have configured it wrong (such as a 0.0 or negative near plane). This has nothing to do with the file. |
|
Back to top |
|
|
losey DeleD PRO user
Joined: 25 Nov 2006 Posts: 35 Location: Hawaii
|
Posted: Tue Dec 19, 2006 6:36 pm Post subject: |
|
|
I'm new to this so your comments will be appreciated. I use:
D3DWindow.AutoDepthStencilFormat = D3DFMT_D16 '//16 bit Z-Buffer
D3DDevice.SetRenderState D3DRS_ZENABLE, 1
By "near plane" do you mean the near and far clipping setting? I am using:
D3DXMatrixPerspectiveFovLH matProj, pi / 4, 1, 0.1, 500
Also changing the file DOES fix the problem such that all mesh objects are displayed correctly. _________________ George Losey |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Tue Dec 19, 2006 7:12 pm Post subject: |
|
|
Until you rotate the camera around the scene, probably...
I have no experience with DirectX, but here are some preliminary pointers until someone with some actual knowledge comes along:
1. Try to set the renderstates for D3DRS_ZWRITEENABLE to true, and the D3DRS_ZFUNC to D3DCMP_LESSEQUAL
2. Make sure you are clearing the z-buffer prior to rendering (D3DCLEAR_ZBUFFER or D3DCLEAR_TARGET)
3. Depending on how large your object is, 500 seems a bit small for the far plane. DeleD-made objects are usually larger. That also means 0.1 is a bit small. DeleD's own defaults are 10 and 30000.
4. With OpenGL, you usually get problems like this if you forget to specify PFD_DOUBLEBUFFER in the dwFlags of the pixelFormatDescriptor set on the device handle. I don't think you have to worry with that if you are on DirectX, but perhaps something similar needs to be specified? |
|
Back to top |
|
|
losey DeleD PRO user
Joined: 25 Nov 2006 Posts: 35 Location: Hawaii
|
Posted: Wed Dec 20, 2006 1:21 am Post subject: |
|
|
Camera moves around just fine. I did change the limits as you suggested. In fact my scene is 2800 deep.
Thanks _________________ George Losey |
|
Back to top |
|
|
|