General Category > General Anim8or Forum

WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)

<< < (44/58) > >>

cooldude234:
5th post in a row? eeeh I wasn't expecting this much progress all at once :P
Well doing some debugging and some math in my head I finally realized the full picture of the mess I had made ;)

See the image below for reference.

(get ready for not that much math :P)
The way I had designed this algorithm is so that you would get the distance of the edge, 1&2.
Generate a random number between that value and zero. Find the scalar of that value (so if the number was half of the distance of edge 1&2 the scalar would be 0.5), apply that to the second edge (by multiplying the distance of 1&3 by the scalar). So that way there would be a random point on both edges with the equivalent scale. I would then find a random point on the distance between the scaled lines, find the scalar from that, and project one of the scaled lines (depending on the order) by that number (scaled line multiplied by new scalar).

I'm doing what seems to be half of that, because of the way I implemented the U and V coordinate system (to fit a triangle instead of a square), I kinda made a interesting matrix operation for triangles :P (once again just look at the image below).

Sorry if you don't understand, I just suck at explaining things without making a picture book about it :D

NOTE: the matrix operations part was a joke, I'm just too tired to decipher whats funny and whats not

cooldude234:
Okay, Great news to share to you I have!
I have fixed it and now it works perfectly.
What I did was a made an exponential value based on the V value (or U on the whiteboard). So the smaller V gets the more spacing there is between each segment. (now there's a lot of overlapping in this next image because I'm drawing about 500 objects in place, but that's just because I was too lazy to remove the random function part :P)
And I can easily change the distance between each segment (I guess that's what I could call it, segment that is).
Just take a look :D

EDIT: okay my exponent isn't working like I initially thought (I need to find the formula to scale it properly when changing the distance between each segment) but I am on the right track (I hope :P )

EDIT2: lol I know why my exponent is not working, duh the triangle is variable in shape and size, so I should't be working making the exponential decrease based on one edge (basically I need the size to be relevant to the world space in this case).

EDIT3: heheheh my post count is 555 :D

cooldude234:
Okay so collision is slightly back to the title of slightly working.
Apparently the collision works, but the position of the physical triangle and the visual triangle are very off, and in a non constant manor. Meaning that one triangle has it's collision below, meanwhile another has it's collision to the right of it?

A least I got a taste of some sort of accomplishment.

Also working on making font's look nicer and less pixelated.

EDIT: Also it seems that closer to the origin of the world (x0,y0,z0) the less distance there is to the polygon and it's collision and the further away the more distance there is. (reason why the large polygons seemed to have issues over the smaller ones, because the smaller ones were near the center :| )

EDIT: I've pinpointed it down to the fact that the physical polygon and the visual polygon are displaced on its normal. IE take the visual polygon, go backwards along it's normal and at some point you will hit it's collision.
Also it seems that the end section (checking to see if the collision is inside the triangle) isn't wrong, nor the part for calculating where the collision is on a plane, but rather somewhere in between that. THIS IS GOOD though, because now I know where in the code this headache educing poop is dwelling.

Thanos:
You're seeing some light about the collision issue? That's great! It was making me feel kinda down.

cooldude234:
I know that feels bro ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version