Problem Adding Lines as ground for physics

i’m trying to add line to physics, result is interesting and i’m not able to continue and find a workaround

please have a look at below image

and below is code

local ll1 = display.newLine( 110, 268, 260, 268 )  
ll1.width=8  
ll1:setColor(255,245,0)  
local lgr = display.newGroup ( ll1)  
physics.addBody ( lgr, "static", {density=1, friction=.5, bounce=0})  
  

the reason for using lines is that i want to add ground to my game screen
which is read from svg file, a set of points as polyline

looking at this result, i’m now confused what vector graphics i have to use
is there any way i can make complex physics structure without using image

suggestion and help is much appreciated
[import]uid: 97420 topic_id: 17416 reply_id: 317416[/import]

I’am not sure if I understand you correctly but I’am using display.newRect and adding physics for it.
You don’t have to use any image. [import]uid: 13156 topic_id: 17416 reply_id: 65968[/import]

@sravan,
I am surprised specially when you say

i’m a VC++, C++ and OpenGL developer for almost 6 years and a freelancer.
i’m more interested in game programming and learn new techniques and
languages.
Corona is good and easy, but i think still a long way to go

and then you have questions, yes there are a lot of things that Corona might lack, but generally it is the developers that have a long way to go. After all if the caveman had asked for CAD/CAM before he started to make the cave paintings… where would we be today?

As for your question, instead of a line that is 8 pixels in width, have you tried using rectangles instead?

instead of newLine(110,268,260,268)

[lua]newRect(110,268,150,8)[/lua]

Secondly, you are trying to make the group a physics body, I am not sure that is a good idea. You can join the various vectors using joints, and static stay in one place anyways.

You are running this in Hybrid mode, if you run it in normal, does it suffice what you need or is it still an issue?

Because your question as Piotr has also mentioned is a bit vague and unclear.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 17416 reply_id: 65978[/import]

earlier screenshot is from my testbed and line drawing for understanding the problem why line is not properly added physics.
(even without adding to group)

all line drawings in my game i used rectangles instead of line.
let me make it clear with picture again, what i’m trying to add is series of lines like this


so, Jayanth, you are suggesting me to use rectangles and rotate them and add to physics here??
will it not be a overhead ?? [import]uid: 97420 topic_id: 17416 reply_id: 66120[/import]

Has this problem (applying physics over lines) been solved and I`ve missed it or is it still going on guys?

PS: BTW I`ve tested using the build 704b and still see the problem anyway. :\
Thanks,
Rodrigo. [import]uid: 89165 topic_id: 17416 reply_id: 95062[/import]