Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by JustAnotherRobot · Mar 01, 2021 at 07:32 PM · spritegameobjectsposealign two objects

Aligning gameobject with image,Aligning gameobjects with 2d image

Hello everyone,

I am note sure if this is the correct place to ask this question but this is my best guess for now as I am new to Unity. (If I am in the wrong place, I'll be glad to learn how to post such a question)

I was thinking of an application that allows the user to move a gameobject and align it with a 2d picture (later a videostream) of said object in a scene. You can imagine it something like what the person has shown here

To test this I took a photo of a box on a table which I then imported to Unity.

I measured the box, where the camera was placed and calculated what the coordinates of the box relative to the camera (which I used in coordinates 0,0,0). I then tried to reconstruct the scene in Unity placing the camera and box in on the coordinates I calculated.

Now for the picture. I imported it in the scene but I am unsure how one would logically place it, so that wherever the box is placed by the user to align with a photo, the Box will have the correct coordinates. The coordinates don't have to be perfect but in the end I would like to get a somewhat right 6dof pose of the placed object.

However right now looking through the camera the object does not align with the reference image at all. One thing I don't know is how one would initally position the image in 3D space? I tried to modify the camera a bit, fitting the FOV and focal length to the ones of the camera I used to take the reference picture. Are there maybe other things I have to take care of?

I am unsure what I am doing wrong or if my initial approach is good at all. Therefore I would be glad about any help regarding this problem!

,

 Hello everyone,

 I am note sure if this is the correct place to ask this question but this is my best guess for now as I am new to Unity. (If I am in the wrong place, I'll be glad to learn how to post such a question)

 I was thinking of an application that allows the user to move a gameobject and align it with a 2d picture (later a videostream) of said object in a scene. You can imagine it something like what the person has shown [here][1]


 To test this I took a photo of a box on a table which I then imported to Unity.

 I measured the box, where the camera was placed and calculated what the coordinates of the box relative to the camera (which I used in coordinates 0,0,0). I then tried to reconstruct the scene in Unity placing the camera and box in on the coordinates I calculated.

 Now for the picture. I imported it in the scene but I am unsure how one would logically place it, so that wherever the box is placed by the user to align with a photo, the Box will have the correct coordinates. The coordinates don't have to be perfect but in the end I would like to get a somewhat right 6dof pose of the placed object.

 However right now looking through the camera the object does not align with the reference image at all.
 One thing I don't know is how one would initally position the image in 3D space?
 I tried to modify the camera a bit, fitting the FOV and focal length to the ones of the camera I used to take the reference picture. Are there maybe other things I have to take care of?

 I am unsure what I am doing wrong or if my initial approach is good at all. Therefore I would be glad about any help regarding this problem!
  


Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by JustAnotherRobot · May 28, 2021 at 04:29 PM

The problem was that I decided to scale my objects/distances to display everything bigger. However as I was using the physical camera it was crucial that I used all values in meter. After making this switch I got the desired result

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

144 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

If i flip the scale from a sprite, how do i make my game object child flip aswell? 0 Answers

Read a variable from other script of same object. 1 Answer

Problem with sprite animation on android 1 Answer

Puttings GUI's between objects 1 Answer

Assigning a Sprite to a Script and creating a Gameobject out of that sprite 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges