Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

order of objects in .x files

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
losey
DeleD PRO user


Joined: 25 Nov 2006
Posts: 35
Location: Hawaii

PostPosted: Tue Dec 19, 2006 1:41 am    Post subject: order of objects in .x files Reply with quote

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
View user's profile Send private message Visit poster's website
jwatte
DeleD PRO user


Joined: 26 Apr 2006
Posts: 513

PostPosted: Tue Dec 19, 2006 4:29 am    Post subject: Re: order of objects in .x files Reply with quote

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
View user's profile Send private message
losey
DeleD PRO user


Joined: 25 Nov 2006
Posts: 35
Location: Hawaii

PostPosted: Tue Dec 19, 2006 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Tue Dec 19, 2006 7:12 pm    Post subject: Reply with quote

Until you rotate the camera around the scene, probably... Very Happy

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
View user's profile Send private message Visit poster's website
losey
DeleD PRO user


Joined: 25 Nov 2006
Posts: 35
Location: Hawaii

PostPosted: Wed Dec 20, 2006 1:21 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum