The problem is you create a new Shape each time, instead replace the
localfunction onEnterFrame(event)local t =os.timer()local alpha =math.sin(t/100)
shape = Shape.new()-- This line
shape:setLineStyle(1, 0xff0000)
shape:setFillStyle(Shape.SOLID, 0xff8000, 0.8)
with
localfunction onEnterFrame(event)local t =os.timer()local alpha =math.sin(t/100)
shape:clear()-- With this line
shape:setLineStyle(1, 0xff0000)
shape:setFillStyle(Shape.SOLID, 0xff8000, 0.8)
And you can also move
stage:addChild(shape)
out of the onEnterFrame function, so it get added only once
Great! Sorry, i not english language. But worked perfectly. (google translate is off)) So soon sorted on visible faces & etc// calculating normals, phong shading ) YES
Faces? Its indexes to coords of poligons to determine the visibility of face to calculate the normal vector, right? if it is negative, then the face is not visible. GLSL this is not necessary. Note that I am only my first experience as a Gideros and in Lua. Thank you! And thank you for recuperate in my corner!
Comments
And you have yourself an awesome and fast effect
Likes: dr_max
Sorry, i not english language. But worked perfectly. (google translate is off)) So soon sorted on visible faces & etc// calculating normals, phong shading )
YES
@dr_max maybe you will be more comfortable with GLSL language?
http://blog.giderosmobile.com/post/60754875527/gideros-2-0-0
Which is available with OpenGL ES 2.0 and shaders in developer preview in Gideros Labs for premium members?
to determine the visibility of face to calculate the normal vector, right? if it is negative, then the face is not visible. GLSL this is not necessary. Note that I am only my first experience as a Gideros and in Lua. Thank you!
And thank you for recuperate in my corner!