Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4345510
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:02:45+00:00 2026-05-21T12:02:45+00:00

Has anyone got a bit of code I can use to change the center

  • 0

Has anyone got a bit of code I can use to change the center point DisplayObjects rotate around in a 3D space? I need it to work with rotationX, rotationY and rotationZ. I know theres a workaround of wrapping every object in aother sprite and offsetting the x & y positions but I’d much prefer a math solution.

As an example of the problem, this code should make a star shape:

var a=new Sprite()
addChild(a)
a.graphics.lineStyle(0,0xFF0000)
a.graphics.moveTo(10,10)
a.graphics.drawRect(100,100,100,100)

var b=new Sprite()
addChild(b)
b.graphics.lineStyle(0,0)
b.graphics.moveTo(10,10)
b.graphics.drawRect(100,100,100,100)
b.rotationZ=45

…

UPDATE: Thanks to Alex for the tip, I’ve posted a reusable solution here 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:02:45+00:00Added an answer on May 21, 2026 at 12:02 pm

    You need to be using a Matrix3D object, and applying that to a DisplayObject instances transform property. You need to define the DisplayObject’s z property first before you can apply the 4×4 3DMatrix transformations.

    So something like:

    myObject.z = 1; 
        myObject.transform.matrix3D.appendTranslation(10,10,0);
        myObject.transform.matrix3D.appendRotation(1, Vector3D.Y_AXIS);
        myObject.transform.matrix3D.appendTranslation(-10,-10,0);
    

    From: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix3D.html

    Hope it helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone got a script for git that can go through the history, check
Has anyone got this working in a web application? No matter what I do
Has anyone got practical experience or a reference for a scheme that implements a
Has anyone got any experience/thoughts on the CSLA.netContrib project on codeplex - here .
Has anyone got any idea why the menu is rendering below the rotating images
Has anyone got this configuration working? Latest Netbeans, latest Glassfish, I created an EJB
Has anyone got an emacs regexp handy to do the following generic replacement? (*ptr_to_struct).member_var
Has anyone ever used the hidden class PackageParser in Android source code with java
Can someone explain to me how I convert a 32-bit floating point value to
I've got a bit of a doubt with UITextView s. I use to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.