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 Professional Discussion / help build Icosahedron

Author
Message
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 25th Aug 2016 08:50
help build Icosahedron

using dbpro
VitebskStar@tut.by
icq: 157980031
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 25th Aug 2016 15:18
In Dark-Basic you can create a icosahedron by building the object from triangle meshes. The triangle meshes can be combined into a single object with Add Limb or Add Mesh To Vertexdata. The Matrix1Utils plugin has the function Make Object New. With this function you can set the Flexible Vertex Format, Vertex Count and Index Count to build a blank object. Then with the vertex data and index data functions you can set the vertex data and index data for the object.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Aug 2016 15:48
Hi there.
@WickedX.....good answer...I was making an example more or less with the same result.

@Star Vitesbsk.
This question looks more like a challenge to me . I didn't even know an icosahedron had 20 faces. I'm not good at math, but if we see an image of it, we all can guess where the vertex are and how manage to spread out all vertex.

If we make a function to make triangle each tri vertex, we can do nearly everything. Here's a little example of an icosahedron made in Dbpro. I hope it helps.

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 25th Aug 2016 23:54
Nice Chafari!
How did you work out the positions? Trial and error? Logical progression? Pure math?
Send your parents to noisy sprite demo hell... enter the D-Zone
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Aug 2016 08:32
Quote: "How did you work out the positions? Trial and error?"


Well as you can see, it has 12 vertex...one up, then two rings of five and the one down.

First I made them all at once....

Quote: "
for i= 1 to 12
make object box i,1,1,1
yrotate object i,72*i
move object up i,9
if i>5 then move object down i,18:yrotate object i,(i*72)+72/2
move object i,15
next"


Then move all vertex to the first ring position( 9 units up )

Vertex number bigger than five correspond to the second ring...so we have to move them all 18 units downwards ...the las step was position manually the vertex of top and down.

As you can see, I made it ti show in screen all vertex numbers....so it was easy to guess what vertex to use for each triangle....so I wrote down in a piece of paper all vertex combination....that was all....that us not really math....as I commented , I didn't know exactly what figure was an icosahedron....then I saw an image at google and as you know... I like challenges...it took me no more than half an hour....of course I had my function for make triangles....so I think using the same method, we could do lots of different primitives.

Chers

I'm not a grumpy grandpa
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 27th Aug 2016 01:14
Quote: "I think using the same method, we could do lots of different primitives."


Yes indeed... I'm surprised there haven't been more attempts by members at their own modeling programs in DBP....or at least a nice custom primitives generator.
Send your parents to noisy sprite demo hell... enter the D-Zone
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 27th Aug 2016 07:56
excellent !!!
VitebskStar@tut.by
icq: 157980031
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 28th Aug 2016 12:21
drawn incorrectly, please help

original code attached in the file

here is the code:
VitebskStar@tut.by
icq: 157980031

Attachments

Login to view attachments
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Aug 2016 18:31
Hi there.
This is much more a child's play.....we need really math here....it is hard to guess where the problem ist on the fly....at first view it looks like you have missing vertex or triangles...there must be a math out there that could help here.


Cheers.
I'm not a grumpy grandpa
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 28th Aug 2016 19:21 Edited at: 28th Aug 2016 19:21
I think it's in the formula:

original code vb6:



in the original, no radians, I introduced them, and only then began to draw more or less normal:


probably in one of the lines necessary to also change the degrees to radiants
VitebskStar@tut.by
icq: 157980031
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 28th Aug 2016 19:53
Quote: "probably in one of the lines necessary to also change the degrees to radiants"


Yeah...it works ok in front and back but something wrong happens on left/right sides
I'm not a grumpy grandpa
Star Vitebsk
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: Belarus
Posted: 28th Aug 2016 19:58
I suffer with it for a week, well, I can not figure out where it is not so ....
VitebskStar@tut.by
icq: 157980031

Login to post a reply

Server time is: 2024-04-20 07:47:22
Your offset time is: 2024-04-20 07:47:22