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 tr0ma · May 07, 2013 at 03:59 PM · camerarenderingpanning

Camera Panning in the context of a game with prerendered backgrounds

Hi there,

A bit of background: Since I miss the old school RPG from the PSX (FFVII/IX, Chrono Cross, Parasite Eve) I've decided to give it a go myself on Unity and learn a bit more about this rendering technique. Basically those types of games include a 2D prerendered background mixed with 3D elements (characters, interactive objects...)

So far so good, I managed to find a way to match a camera from 3dsmax with the one from Unity so that the 3d scene in Unity fits perfectly with the background. With the use of a very simple shader, and a modification of the rendering order, I can have my character walking behind 2D elements from the rendered background. And finally I got my controls working relatively to my camera angle. Brilliant.

Hopefully a little demo will come along the way soon enough.

Now my problem is about camera panning. Since all this can work only with a fixed rendered background, it's absolutely crucial to not move the camera at all in the 3D scene in Unity. However some of the games I mentioned above found their way around by "dragging" the scene as you would drag a 2D image. So you would drag both the background and the 3d scene together in the required direction.

Would this actually be possible in Unity? Would that mean that what the 3D camera can see needs to be bigger than the size of the screen?

At first I thought it would just be about playing around with the normalized viewport rectangle. But I don't think this functionality fits the purpose of this feature.

Does a projection matrix needs to be involved there?

Here is an example to illustrate what I would like to achieve: http://youtu.be/8khIPlWbixI?t=11m2s

Any help would be well appreciated. Thanks.

EDIT: This looks more like an appropriate example http://youtu.be/8khIPlWbixI?t=15m50s We can clearly see here that the camera is not getting any transform value changed. Instead, the whole scene is moved with a vertical offset, both 2D background and 3D elements.

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

Answer by tr0ma · May 10, 2013 at 01:11 AM

I have provided a possible solution here: http://answers.unity3d.com/answers/453367/view.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 shawn_t · Jul 18, 2013 at 08:41 PM 0
Share

Can you provide more information or some code snippets on how you accomplished this? $$anonymous$$y thought is that you might be able to create your own projection matrix to view an off-center portion of the 3D scene (http://docs.unity3d.com/Documentation/ScriptReference/Camera-projection$$anonymous$$atrix.html)

For example, if your device screen is 640x480 and your 2D pre-rendered background is 1280x960 then couldn't you view the bottom left of the 3D scene by using (0, 0) -> (0.5,0.5)?

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

15 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

Related Questions

What is rendered when no camera is in the scene? 1 Answer

Multiple post processing profiles? 2 Answers

Camera layering with post processing? 0 Answers

Green Creep? Any idea what might be causing this visual glitch? 0 Answers

What's going on with rendering? 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