Wireframe, Stroke and Scaling

I’m trying to render a wireframe where the width of the wire is one pixel. I’m using a stroke with a width of one. The problem is as the scene is scaled in and out the stroke is scaled as well.

How can I render a wireframe and keep the stroke at one pixel regardless if scaling?

Thanks in advance. [import]uid: 118456 topic_id: 20925 reply_id: 320925[/import]

Try not adding your wireframe to the group and removing it upon changing scene perhaps? [import]uid: 84637 topic_id: 20925 reply_id: 82579[/import]

Danny, thanks for the feedback but I’m not sure I’m following you. I’ll provide some additional context to my app / question.

I’m modeling some data via wireframes. For example:

local item = display.newRect()
item.strokeWidth = 1

and

local line = display.newLine( )
line.width = 1

etc.

Okay, that data has [world] coordinates that don’t map 1:1 to the pixel (screen coordinates). Therefore I’m using group:scale(xFactor,yFactor) to scale the wireframe up to fill the desired portion of the screen. When I do this the nice one pixel wide stroke becomes very thick, much more than one pixel.

Thanks
Josh
[import]uid: 118456 topic_id: 20925 reply_id: 82586[/import]

This is a natural side effect of scaling.

If it has to stay 1 pixel, you will have to draw it bigger. [import]uid: 84637 topic_id: 20925 reply_id: 82589[/import]

I’m not sure what your app is, but can’t you scale up the data first?
Then you can round the data so it maps to the pixels?

-Angelo [import]uid: 12822 topic_id: 20925 reply_id: 82610[/import]

Thanks understood. I’m currently transforming my model data based on screen size. Coming from an opengl background where i would simply move the camera around and not transform the model data itself, it just felt so wrong to add this extra (transformation) logic in manually.

No worries though.

Thanks
Josh [import]uid: 118456 topic_id: 20925 reply_id: 82629[/import]