Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
1
Question by ThePwnicorn · Feb 24, 2016 at 07:08 PM · mobile devicesuv mappinguvstexture atlas

Mobile camera, take picture and map image to uv coordinates on a model at runtime.

Hey guys, I've been trying to wrap my head around runtime texture swapping. I'd like to be able to access the device's camera, both android and IOS and allow the user to take pictures and map portions of their camera shots to a model, like mapping different user-taken pictures to walls of a level. My initial thought is to create a texture atlas of the different pictures the user takes, maybe save as a texture and allow for swapping/choosing different textures to apply to level geometry.

My questions are as follows:

What's best practice in accessing devices camera's (cross platform) to take pictures? I actually don't mind buying something off the asset store if it's relatively performance-friendly and works across IOS and android.

How should I be planning my code to account for different screen/device resolutions to create a consistent texture atlas across different phones?

Lastly, how do you suggest I approach swapping uv coordinates at runtime to choose different textures for different geometry?

Also I'm thinking of having just a portion of the picture the players take be saved for the texture atlas. Like, maybe the center of the image and the rest get dropped.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by rushikesh988 · Feb 26, 2016 at 06:00 AM

For your first question you can use something called as WebcamTexture . http://docs.unity3d.com/ScriptReference/WebCamTexture.html

To take photo and use its texture you can use:

 WebCamTexture webCamTexture = new WebCamTexture();
 webCamTexture.Play();
 Texture2D PhotoTaken= new Texture2D(webCamTexture.width, webCamTexture.height);
 PhotoTaken.SetPixels(webCamTexture.GetPixels());
 PhotoTaken.Apply();


Here PhotoTaken is the texture of photo.

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
avatar image
0

Answer by Lanre · May 26, 2016 at 07:16 PM

Although I don't know the answer to most of your questions, I surely know the answer to the first: NatCam. It is a fully cross-platform camera solution specialized for iOS and Android. It is blazing fast, has a ton of normal camera controls (like flash, focus, zoom, torch, and so on) and has amazing support.

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
avatar image
0

Answer by dhruv1905 · Aug 05, 2017 at 10:11 AM

Did you figure this thing? Actually I am working on the same concept in bit different way. If you can help! Thanks.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Delete Uv2 of a mesh? 1 Answer

Problem with UV maps and textures 2 Answers

Texture Atlas and planar UVs 0 Answers

Substance Material UV tiling 1 Answer

More materials smaller texture size vs less materials bigger texture size 0 Answers


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