How to make lineTexture with line fixture?

General discussion about the R.U.B.E editor
Post Reply
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

How to make lineTexture with line fixture?

Post 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
1.png (106.87 KiB) Viewed 176848 times
2.png
2.png (114 KiB) Viewed 176848 times
5.png
5.png (117.63 KiB) Viewed 176848 times
Can you please give the code of this algorithm ? Thank you very much!
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make lineTexture with line fixture?

Post by qq200600 »

And if the fixture like this, how to render the mesh ?
_XWG{ZPP~N(LY~ZN)W))[IW.png
_XWG{ZPP~N(LY~ZN)W))[IW.png (10.05 KiB) Viewed 176847 times
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make lineTexture with line fixture?

Post by qq200600 »

I want to render the Right Angle to like this:
SmartSelectImage_2016-08-25-16-23-02.png
SmartSelectImage_2016-08-25-16-23-02.png (220.15 KiB) Viewed 176847 times
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to make lineTexture with line fixture?

Post 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
normals.png (55.72 KiB) Viewed 176844 times
Apart from that, it looks like you are doing a good job.
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make lineTexture with line fixture?

Post 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
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to make lineTexture with line fixture?

Post 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.
qq200600
Posts: 29
Joined: Fri Dec 28, 2012 9:27 am

Re: How to make lineTexture with line fixture?

Post by qq200600 »

OK, Thank you.
Post Reply