• 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
Question by KB73 · May 15, 2014 at 08:42 PM · 2dgraphicsgridgraphchart

infinite 2d grid in an Editor Window

Having trouble with what should be a trivial problem. I have a 10x10 grid rendered into an EditorWindow via GL. I can scroll the grid infinitely and i can zoom it infinitely by multiplying the underlying cells by x2 and wrapping that zoomfactor so it loops back to 1. If i keep the grid at my 'scrolled' origin then it all works great.

If i 'scroll' the grid, the cells 'pop' when they should be smooth everytime the zoom factor loops. So, having realised i needed to apply an offset to compensate for the zoomed origin of the graph, i now have issues with scrolling through it smoothly. It appears to be non-trivial in calculating the cell distance travelled via a modulus.

So...i feel i'm probably going tackling this issue the wrong way and making it more difficult than expected. So the question should be more, how would you do it..so that ultimately it will support framing of a certain region of data and so on and allow the user to smoothly scrolling around, in and out like the softimage editor etc..

Any ideas/insights would be helpful. thanks

Comment
rednax20

People who like this

1 Show 0
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

  • Sort: 
avatar image

Answer by KB73 · May 15, 2014 at 08:59 PM

Also, there is no 'camera' in the editorwindow so it has to be either manipulation of the GL verts or using Matrix4x4 class and submitting that...both show the same issue. The biggest issue i am having is with the scrolling of the grid. Trying to use something like scrollOffset % cellSize is failing to work when the thing zoomed.....regardless of whether the cellSize is a zoomed or unzoomed value.

Comment

People who like this

0 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 KB73 · May 16, 2014 at 04:51 PM 0
Share

All fixed, best info i found was in a book online called Practical Charts and Graphs C# and it pretty much addressed everything i needed.

avatar image BiatuAutMiahn · Apr 27, 2016 at 12:53 AM 0
Share

Can I get an example of ur code? I am trying to do the same thing as a part of a bigger project, but I'm having trouble getting started. Ty

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

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

Related Questions

2d graphics 3 Answers

How to use the same tilemaps among multiple scenes (e.g. making it a prefab)? 0 Answers

Instantiate gameobject on random position on 1. a graph and 2. another gameobject 0 Answers

Sync two animations on two different gameObjects 0 Answers

May I execute C# applications inside my game? 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