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 Captain_Dando · Feb 06, 2013 at 01:53 PM · 2dorthographicperspective

Is it possible to have perspective and orthographic objects viewed simultaneously?

Hi everyone, I am in the process of building a 2D game, using sprites on planes viewed from the side in orthographic perspective for the player and most of the scenes. for some scenes, I would like to have perspective backgrounds that move as the player moves from left to right, such as in this screenshot from Castlevania: symphony of the night:

alt text

It's a bit difficult to see here, but the houses in the background are 3d and move as the player moves. Is this kind of thing possible using my method?

castlevania-symphony-of-the-night.jpg (55.7 kB)
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
1
Best Answer

Answer by Captain_Dando · Feb 06, 2013 at 02:59 PM

Ok, I've just found an answer to this question on another answer [here][1]:

"An alternative to single camera is to use two or more cameras. By default they will both render to the entire screen. You set the depth of the cameras to determine which one renders first, and you set the clear flags of the later camera(s) so that it keeps the image from the first camera as the background.

This approach has a disadvantage, that the two cameras won't automatically move in sync. You may have to write a script to move the background camera (slowly) as the foreground camera moves with the player.

But this approach may occasionally be useful. Examples:

*With the single camera solution, if the background plane needs to be very far away you might have issues with clipping planes and z-precision.

If parts of the background sometimes move independently of the foreground, for instance if they are on a vehicle and you want to show the background scenery moving by. If you want to avoid interaction between the layers. For example, if there were objects that travel away from the camera and you find them running into the background plane. I just thought it would be useful to mention this option. But I would start with the single-camera approach (alpine's answer) and add more cameras only if you need to. I'm guessing you won't."* I've just tested this, it works and it looks like it could have some interesting results. Remember to set the clear flag drop down on your highest cameras to don't clear so that they have no backgrounds. you can effectively render as levels, like in photoshop. I suppose you could also use this to have a 3d GUI if you desired [1]: http://answers.unity3d.com/questions/24628/how-would-i-go-about-constructing-a-layered-scene.html
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 Bunny83 · Feb 06, 2013 at 03:12 PM 0
Share

$$anonymous$$eep in $$anonymous$$d that in some situations it makes more sense to set the clearflags to "depth only". This will clear the depth buffer, so no geometry from the other camera can block parts of your second camera. This is usually used to render the weapon in a FPS game. This ensures that it's always drawn on top of everything else, even when it would intersect with a wall.

avatar image
2

Answer by KingKongFu · Feb 06, 2013 at 02:08 PM

Never played casltevania, but I think I get the jist of what you want done. To me it does not look like a 3d model but a really good 2d background, but that being said I never played the game so I dont know for sure.

What you can do is attach the background buildings to the 2d sprint so that it will move with the player. If wanted add a delay or add and minus some x values to move the background a little more dynamically than just the parenting of it to the player which would just be a 1:1 movement ratio.

Hope that can get you on the right track

Comment
Add comment · Show 4 · 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 Captain_Dando · Feb 06, 2013 at 02:39 PM 0
Share

It's a little hard to see in a still picture, but in motion it definitely looks like it's 3d. I was previously considering using a material which uses a camera as it's texture, and then setting that camera to perspective and putting it's view behind the player and stage, but it looks like that shader is not available in the free version

avatar image KingKongFu · Feb 06, 2013 at 02:45 PM 1
Share

Also To my knowledge as limited as it is, I think you can only use one perspective for a camera at a time. You can alter this in code but it wont allow you to render in two different perspectives at once.

If you want to try the pro version and see if this would work. $$anonymous$$ake a movie of the background and then apply that movie as a material to a background, I dont know if that would give the effect your looking for though.

avatar image Captain_Dando · Feb 06, 2013 at 03:00 PM 0
Share

Just found the answer on another question, sorry to waste your time, though you have given me a good lead on getting the background to move with the character :) thanks!

avatar image KingKongFu · Feb 06, 2013 at 03:09 PM 0
Share

not a problem I learned to so its not a waste made me think about it good you found an answer :)

avatar image
0

Answer by Nodrius · May 03, 2014 at 12:19 PM

Hi. Captain_Dando you said you found answer in other question, please can you link to it? Im searching for the shame thing

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

12 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

Related Questions

Making a camera semi-orthographic 2 Answers

Camera 2D RPG in perspective 1 Answer

Stairs in 2D 1 Answer

Resizing orthographic camera to fit 2d sprite on screen 1 Answer

Sprite relative position/scale problem with orthographic camera 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