0

this is a copy from another question, I try to modified it to rotate on the y axes--not so much for a 3d view, but as a flip, like a card, or a page-- but I can't seem to figure it out, I triad the api reference and documentation, but it's mostly like w3c for the reference section--even know, w3c give some code explanation on how it'll look in productivity--.

How to rotate period. What do I use? state? or Phsyics.transform.rotoate? And if so, how?

// create a behavior to handle pin constraints
Physics.behavior('pin-constraints', function( parent ){
    return {
        init: function( opts ){
            parent.init.call( this, opts );
            this.pins = [];
        },

        add: function( body, targetPos ){
            this.pins.push({
                body: body,
                //wouldn't this be change to Physics.vector.prototype.rotate( targetPos )
                target: Physics.vector( targetPos )
            });
        },

        behave: function( data ){

            var pins = this.pins
                ,pin
                ;

            for (var i = 0, l = pins.length; i < l; i++){
                pin = pins[ i ];
                // wouldn't this chagne to pin.body.state.angular.pos 
                pin.body.state.pos.clone( pin.target );
            }
        }
    };
});

this is for a question for PhysicsJS user and creator.... --I was instructed to post here if I have questions--

Community
  • 1
  • 1
L2L2L
  • 83
  • 2
  • 10
  • Is this your modified code or the original? If you have copied it, why not provide a link to the original question for reference? – mechalynx Sep 30 '14 at 01:03
  • I added the anchor link, the anchor link is the word question. – L2L2L Sep 30 '14 at 01:10
  • Could you clarify your question? I don't understand. How does this code, and the question you've linked to differ? Why does that not solve your problem? – Jasper Oct 01 '14 at 21:24
  • sure I would like to do a fill rotate in the z plain but not really 3d... but imitating 3d. I can do this in regular canvas using the transform--I don't remember which one, but I save the code-- and I was just wondering if there is away to do so--give me sometime I'll repeat the experience. – L2L2L Oct 02 '14 at 03:12
  • So I was center scaling it, like I side, it's not true 3d rotation, but as long as it is precede to be seen as so, that's all I need. – L2L2L Oct 03 '14 at 00:31

0 Answers0