Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Triangulating

Author
Message
Manson
22
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Denmark
Posted: 28th Apr 2003 03:35
Does anybody have piece of code for triangulating a poly?
Hamish McHaggis
22
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 28th Apr 2003 13:58
??? Do it in a modeller! I don't think you can edit polygons in DB.

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Leade
22
Years of Service
User Offline
Joined: 8th Nov 2002
Location: United Kingdom
Posted: 28th Apr 2003 17:48
Do you mean finding if a position intercepts a trangle polygon. and returning the position on the triangle.
because if you are: let me know when you find something because i'm to looking for somthing simlar.

However i'm so close to finding the solution but the code is based on faces and not polygons.

i'll probably write it in c++ because it has a command called CataMullRom which returns a 1 if true. (So i've been told)

Watch this space
Leade
Manson
22
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Denmark
Posted: 29th Apr 2003 00:26
Well, I'm trying to actualy program a game,,,
I need a piece of code that devides a polygon into triangles.
The coordinates for the poly will be stored in an array.
This seems to be possible in a few ways, however I can't get any of them to work,,,

Leade: you're probably looking for something like projecting of a vector onto a plane,,,,

Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 1st May 2003 19:50
Did you check out the demo "mesh data access" in db1.13/enhanced help?

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd May 2003 01:49
Is your poly flat and convex? Under these circumstances, it's quite easy to break it up into trangles, by using a fan of triangles.

It's easy to see if you draw it. Draw the 6 points of a hexagon, and number the points from 1 to 6.

Your first triangle is 1,2,3.
Your second is 1,3,4.
Your third is 1,4,5.
Your last is 1,5,6.

See the pattern? It works for any number of points.

Login to post a reply

Server time is: 2025-05-17 03:53:10
Your offset time is: 2025-05-17 03:53:10