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
3
Question by bhavesh · Jul 25, 2011 at 08:04 AM · renderersphereareaselectedtexure

Set image or texture on only particular part of a sphere

Hello Everybody,

I am creating application similar to google earth.

Initially I have set one image on sphere.

I have written C#-script for Rotating sphere using Mouse and Zooming sphere using Mouse double click and Mouse Scroll Wheel like google earth.

Now when I will zoom sphere at that time I want to render image on perticular part (Clicked Part) of sphere only.

Can anybody suggest me what to do for that ?

If anybody can provide me any sample piece of code then it will be better.

Thanks in advance.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Mojtaba · Jul 25, 2011 at 10:17 AM

You can change the texture of sphere material to a larger texture.

renderer.material.mainTexture = _largerTexture;

You just need to check the position of mouse click on sphere using raycast and load related larger texture.

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 bhavesh · Jul 26, 2011 at 11:06 AM 0
Share

Thank you AliAzin for the feedback,

I can load larger texture of World $$anonymous$$ap up to some Zoom Level, But when Zoom Level is very high at that time the size of Whole World $$anonymous$$ap will be very large, at that time it is not feasible to render whole image on to sphere.

So that I want to render Part of World $$anonymous$$ap image on to Specific Portion of the Sphere so that no need to render whole image.

Is there any way to do this thing ?

Thanks.

avatar image
0

Answer by Alec-Slayden · Jul 25, 2011 at 05:34 PM

That's an interesting problem. There are means of fiddling with UVs that I'm not really sure of, but if I were to tackle the problem without that knowledge, here's what I would try (although you will lose some color detail without tweaking).

I would have my globe sphere, but then I'd also have 2 copies of the globe, which I cut into hemispheres, roughly N/S/E/W. When a target is selected for a zoom, one of these hemispheres will be in full view at a certain magnitude. To help this along, I'd fiddle with their rotation so that there is no spot that is too close to a crease on ALL hemispheres.

These hemispheres would be given a properly aligned texture of higher resolution, and since the surface area is half the size of the sphere, there won't be a larger file size. These are initially inactive, and very slightly smaller in scale than the globe (so they're beneath the surface).

For the first order of magnitude or two, the globe is probably fine. Once it's been determined what hemisphere we're looking at (perhaps through clever collider use earlier), that hemisphere becomes active, and the alpha of the globe fades, and now we have a high res hemisphere for another order of magnitude or two.

We can't keep chopping up the globe to smaller bits, of course, so what I would do next is gather up and organize all my smaller scale maps, and use a light projector (in a static position) pointed at the sphere's surface from a perpendicular axis. From here, any zoom you want to do is trading between 2 projectors: the initial one, and one that is closer to the surface. The first one fades out as the closer one fades in (presumeably once it is filling the view). Since you can't Really keep walking the projectors closer forever, Once you're that close it might be easier to choreograph movement of the projectors or their parameters rather than moving the camera much, since you'll likely be approaching the clip plane. This can give the illusion of further magnitude.

Obviously this requires a lot of choreography in animating the alpha of the globe, the material of the hemisphere, and the intensity of the projectors, and thats if you don't try going further than the second projector in magnitude... But that's probably what I'd try.

EDIT: there's always going to be an intersecting crease with the hemispheres, so... it would have to be 3 copies, so 2 extra hemispheres will make up for that spot (on the bright side there wouldn't have to be any rotational fiddling)

Comment
Add comment · Show 2 · 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 bhavesh · Jul 26, 2011 at 11:07 AM 0
Share

Thank you Alec Slayden,

I am rotating and zoo$$anonymous$$g sphere throught C# scripting.

When user $$anonymous$$ouser Over or Double Click on the Sphere I am getting logitude and latitude of the sphere.

I am getting image from Bing $$anonymous$$ap using this Logitude and Latitude value and want to set in particular part of Sphere only and this will be totaly dynamic through C# script.

I am not aware of 3D concept and not aware of any 3d software and unity. But I am good at program$$anonymous$$g in C# and want to do this thing using C# scripting.

Is there any way to accomplish this thing ?

Thank you.

avatar image Alec-Slayden · Jul 26, 2011 at 01:05 PM 0
Share

Perhaps through the use of only projectors as you get closer to the sphere? Though I have had trouble with their color quality myself

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Special question about collision thingy 0 Answers

Changing two different objects renderer colour 1 Answer

areas(continents) on my spherical planet 1 Answer

Changing material on prefab 0 Answers

Issue with Mesh Renderer and Skinned Mesh Renderer 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