Page 1 of 1
How to make lineTexture with line fixture?
Posted: Thu Aug 25, 2016 7:04 am
by qq200600
Hi,@iforce2d:
I have look the algorithm
https://www.iforce2d.net/blog/2013-07-20
The WHITE LINE IS FIXTURE!!
I use the normals and mesh. but have some errors.
- 1.png (106.87 KiB) Viewed 177183 times
- 2.png (114 KiB) Viewed 177183 times
- 5.png (117.63 KiB) Viewed 177183 times
Can you please give the code of this algorithm ? Thank you very much!
Re: How to make lineTexture with line fixture?
Posted: Thu Aug 25, 2016 8:21 am
by qq200600
And if the fixture like this, how to render the mesh ?
- _XWG{ZPP~N(LY~ZN)W))[IW.png (10.05 KiB) Viewed 177182 times
Re: How to make lineTexture with line fixture?
Posted: Thu Aug 25, 2016 8:24 am
by qq200600
I want to render the Right Angle to like this:
- SmartSelectImage_2016-08-25-16-23-02.png (220.15 KiB) Viewed 177182 times
Re: How to make lineTexture with line fixture?
Posted: Thu Aug 25, 2016 8:56 am
by iforce2d
This is a very complex topic and not really one for these forums. I have explained it in as much detail as I intend to in the blog post. The source code is also very complex, and it's not mine to give away.
One thing I can comment on though, is that your 'normals' are not correct. They should be exactly in the center of the two main line segments, as I have drawn in green here:
- normals.png (55.72 KiB) Viewed 177179 times
Apart from that, it looks like you are doing a good job.
Re: How to make lineTexture with line fixture?
Posted: Thu Aug 25, 2016 10:10 am
by qq200600
iforce2d wrote:This is a very complex topic and not really one for these forums. I have explained it in as much detail as I intend to in the blog post. The source code is also very complex, and it's not mine to give away.
One thing I can comment on though, is that your 'normals' are not correct. They should be exactly in the center of the two main line segments, as I have drawn in green here:
normals.png
Apart from that, it looks like you are doing a good job.
Thank your, sir. what the mean of "in the center of the two main line segments" ? sorry for my poor english
Re: How to make lineTexture with line fixture?
Posted: Fri Aug 26, 2016 3:51 am
by iforce2d
For each pair of two red lines, the normal should be exactly in the middle. Some of your blue lines are not in the middle.
Re: How to make lineTexture with line fixture?
Posted: Fri Aug 26, 2016 4:55 am
by qq200600
OK, Thank you.