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 

Triangulation

 
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD User Game Projects
View previous topic :: View next topic  
Author Message
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Tue Jun 20, 2006 8:35 pm    Post subject: Triangulation Reply with quote

Hi Cool

I'm new here on this forum.. I am working on a D3D game engine wich is written from the scratch using delphi 7. I thought it would be nice to include DMF support, since Deled is an exellent easy-to-use 3d editor Wink

I have checked out the help files and studied the DMF format a bit, i noticed that an object in a DMF contains multiple polygons wich can have more then 3 vertices. In order to render the scene it is neccesary to triangulate and optimize this data.

before i start writing an algorithm i need to know a few things: Razz
*what is the maximum amount of vertices of a polygon (is there a limit)
*can polygons be concave??
*are polygons always flat or not??

I assume that quite a few of you have done this before. Is there some good pascal code available wich shows how to load a deled map into a Direct3d engine. (opengl is okay but i prefer D3D).

Thanx in advance Very Happy
Chronozphere
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Jun 20, 2006 8:54 pm    Post subject: Re: Triangulation Reply with quote

chronozphere wrote:
Hi Cool

I'm new here on this forum.. I am working on a D3D game engine wich is written from the scratch using delphi 7. I thought it would be nice to include DMF support, since Deled is an exellent easy-to-use 3d editor Wink

I have checked out the help files and studied the DMF format a bit, i noticed that an object in a DMF contains multiple polygons wich can have more then 3 vertices. In order to render the scene it is neccesary to triangulate and optimize this data.

before i start writing an algorithm i need to know a few things: Razz
*what is the maximum amount of vertices of a polygon (is there a limit)
*can polygons be concave??
*are polygons always flat or not??

I assume that quite a few of you have done this before. Is there some good pascal code available wich shows how to load a deled map into a Direct3d engine. (opengl is okay but i prefer D3D).

Thanx in advance Very Happy
Chronozphere


Hi there chronozphere, and welcome! Very nice to see you developing a game engine using Delphi7. DeleD is actually developed using Delphi7 as well. Smile Now, about your questions:

- polygons can have an unlimited amount of vertices
- polygons can be concave (in which case OpenGL will not render them correctly in all cases)
- polygons might not be flat, as DeleD allows you to displace any vertex of the polygon; this might mean you having to triangulate convex polygons as well, if they're not flat

Also, check here for example DMF loading code in Delphi. Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Jun 20, 2006 9:54 pm    Post subject: Reply with quote

DeleD can triagulate for you...

Press CTRL-A, then in object mode use triangulate. I suggest you SAVE AS as new file to not ruin your working copy.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Wed Jun 21, 2006 4:18 pm    Post subject: Reply with quote

Thanx for your replies. Smile

Quote:

DeleD can triagulate for you...

Press CTRL-A, then in object mode use triangulate. I suggest you SAVE AS as new file to not ruin your working copy.


Aah thanx... that's a nice feature. Maybe its an idea to make a "Save Triangulated..." function in Deled ( Just an idea Very Happy)

I've just downloaded the delphi DMF loader.. I will take a look at it Wink
Back to top
View user's profile Send private message
hpesoj
DeleD PRO user


Joined: 16 Oct 2004
Posts: 184

PostPosted: Wed Jun 21, 2006 5:05 pm    Post subject: Reply with quote

Geeze, that reminds me, I haven't given you the updated header file (the current one won't work with 1.4 exported dmfs). New version is 1.1.0, as I've added a few extra functions, such as a sorting function which arranges polygons in material order, and a function that generates flat normals (I haven't gotten around to generating smooth normals, it could be quite complicated). Here is the file:

DelphiDMFLoader.zip (479 KB)
DelphiDMFLoader.rar (289 KB)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD User Game Projects 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