Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 ina · Jun 27, 2011 at 06:40 AM · gameobjectworldspacescreenspace

Convert world to screenspace for screenshot of particular object

Is it possible to convert world to screenspace to screenshot a particular gameobject in the scene?

Say you have a bunch of objects in a scene. Users elects object A within full view of Camera, is it possible to convert this to screenspace to capture just that part of the image in a screenshot texture write (ReadPixels)?

Comment
Add comment · Show 5
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 ckfinite · Jun 27, 2011 at 12:53 PM 0
Share

Well, what do you mean? Do you want to get the coordinates of an object on the screen's 2D space? Or something else?

avatar image Waz · Jun 27, 2011 at 01:59 PM 1
Share

Do you mean "given an object's Bounds and a direction, how do I position a camera in that direction such that it views the whole bounds?"?

avatar image zachypin · Jun 27, 2011 at 03:07 PM 0
Share

By this it seems to me you are saying you want a gameobject, lets say a flat plane in the world, doubling as a movie theater screen. That on lets say "activate" takes a screen shot of the world from your camera's perspective and saves it up onto the plane. Is this correct?

avatar image ina · Jun 28, 2011 at 09:19 AM 0
Share

yes what Warwick said... say you have a bunch of objects in a scene. Users elects object A within full view of Camera, is it possible to convert this to screenspace to capture just that part of the image in a screenshot texture write?

avatar image Waz · Jun 28, 2011 at 09:40 AM 0
Share

The answer is a pile of trig that I'm too dumb to work out. In my current project, I generate icons something like small screenshots like this, but I just have hand-chosen rotation and distance for each class of item (I need to anyway, if I zoomed perfectly my shordsword and longsword would look the same!).

1 Reply

· Add your reply
  • Sort: 
avatar image
-2

Answer by victorvijay · Jun 27, 2011 at 01:39 PM

you can get screen space to a ray and attachit to a object.

var ray: Ray = Camera.main.ScreenPointToRay(Input.mousePosition);

     var hit: RaycastHit;

                 

Comment
Add comment · Show 1 · 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 Waz · Jun 28, 2011 at 09:36 AM 0
Share

This looks like half a posting. Could you finish it or delete it?

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

6 People are following this question.

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

Related Questions

Scale Gameobject with defined size in pixels 2 Answers

Dragging panel(prefab) from screen space canvas to world space canvas and scaling to fit 0 Answers

See if an object is in a portion of the screen 1 Answer

World space and UI space 3 Answers

World BoxCollider size to Match Screen Space UI image size 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