
-----------------------------------
copthesaint
Thu Mar 15, 2012 1:33 am

Mathimatical Relationship
-----------------------------------
Hello, Im currently trying to figure out the relationship of points to form triangles. I realize I am conveying my message wrong however I still would appreciate the help. I made this example program, What I want to do is create a mathematical equation to create triangles where appropriate. 1 line cannot cross through another however lines are allowed to be parallel. The Context of this task Im trying is to generate a random 3D Model.

if anyone has a good calculator maybe it can find a relationship? Atm Im stumped. 

View.Set ("Graphics:800;600,offscreenonly,nobuttonbar")
var font1 : int := Font.New ("Arial:12")
var quality : int := 3


loop

    for i : 0 .. (quality - 1)
        for j : 0 .. i * 2
            var pX : real := ((maxx / 2) + (75 * i) * cosd ((360 / ((i * 2) + 1)) * j))
            var pY : real := ((maxy / 2) + (75 * i) * sind ((360 / ((i * 2) + 1)) * j))
            drawfilloval (round (pX), round (pY), 10, 10, black)
            Font.Draw (intstr (j), round (pX - (Font.Width (intstr (j), font1) / 2)), round (pY - (Font.Width ("W", font1) / 3)), font1, white)
        end for
    end for
    View.Update
cls
end loop

-----------------------------------
mirhagk
Thu Mar 15, 2012 11:16 am

RE:Mathimatical Relationship
-----------------------------------
you could brute force it? There's obviously a better way but if your saving these random models, and do not need to generate them dynamically, then that would work.

You can easily test if two lines segments intersect, simply find the point of intersection between the lines, then see if that point lies on both line segments.

-----------------------------------
S_Grimm
Thu Mar 15, 2012 11:27 am

RE:Mathimatical Relationship
-----------------------------------
Give a look at this article http://graphics.stanford.edu/~pmerrell/tvcg.pdf

i think that its something like what you are looking for. I'll keep digging and see if I find any other stuff for you.

Also let me know if that's along the lines of what you are looking for.

-----------------------------------
copthesaint
Thu Mar 15, 2012 2:40 pm

Re: Mathimatical Relationship
-----------------------------------

you could brute force it? There's obviously a better way but if your saving these random models, and do not need to generate them dynamically, then that would work.

You can easily test if two lines segments intersect, simply find the point of intersection between the lines, then see if that point lies on both line segments.


I want to find an algorithm to solve my problem because the 3D model will not always have the same amount of inner points and outer points. I know how to accomplish my goal however I believe that it would be unprofessional to do specify each line, I would rather have an equation to shorten my code.


Give a look at this article http//graphics.stanford.edu/~pmerrell/tvcg.pdf

i think that its something like what you are looking for. I'll keep digging and see if I find any other stuff for you.

Also let me know if that's along the lines of what you are looking for.


Ill read it and see if it might give me any insight to my problem.

-----------------------------------
copthesaint
Thu Mar 15, 2012 4:02 pm

Re: Mathimatical Relationship
-----------------------------------
@ S_Grimm, I have read the article you have send me, and I was able to create an algorithm, Thank you for the link.

-----------------------------------
S_Grimm
Fri Mar 16, 2012 7:50 am

RE:Mathimatical Relationship
-----------------------------------
no problem man.
