GithubHelp home page GithubHelp logo

Comments (5)

incompl avatar incompl commented on September 27, 2024

Sounds like a bug to me.

from boxbox.

djmichaelb avatar djmichaelb commented on September 27, 2024

Have some more information... if you try want the polygon at location 1,1 and then use the coordinates (assuming a rectangle for example): [{1,1}, {2,1}, {2,2}, {1,2}] then set position to x:1, y:1 then the rectangle will be positioned at 2,2.

If you always assume the polygon is created at origin 0,0 and then set the position then there is no problem. I had assumed you had to calculate the points for the polygon based on your desired starting location, but you have to create the polygon from 0,0.

from boxbox.

incompl avatar incompl commented on September 27, 2024

Oh that makes sense... I think I've fallen into that trap too come to think of it

from boxbox.

djmichaelb avatar djmichaelb commented on September 27, 2024

Actually... I've come to another realisation. I had assumed that [0,0] is the object origin (based on my first attempts at creating a poly shape) however I suspect now that the origin point for the poly is acutally the center... so for a rectangle of width 1 and height 1, centered at [0,0] the points would need to be [-0.5, -0.5], [0.5,-0.5], [0.5, 0.5], [-0.5, 0.5].

I assume you are well across this but it took me ages to figure out (also explained why my images were aligning badly and not behaving properly when the object started rotating).

Thanks for listening

from boxbox.

incompl avatar incompl commented on September 27, 2024

from boxbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.