Jump to content
Memnarch

[3D] Why do i need to use negative Y values to go UP?

Recommended Posts

Ok that is super odd.

Let alone the Y-Up vs Z-Up war, why is this Y-DOWN?

 

Created a new 3DMultidevice Application. Placed a 3DGrid as a plane and added a camera. I wanted the camera to be above the grid so i typed in 5 for the Y-Value. And the camera moved down. I had to use -5 for the camera to go up. Am i missing something?

Share this post


Link to post

Probably because they started from 2D. For screens (0, 0) point is up-left and you need to use positive values to go down.

This originates from old TVs where the analog signal starts from up-left.

Share this post


Link to post
12 minutes ago, Cristian Peța said:

Probably because they started from 2D. For screens (0, 0) point is up-left and you need to use positive values to go down.

This originates from old TVs where the analog signal starts from up-left.

Well that's a horrible reason oO

Share this post


Link to post
On 11/23/2018 at 8:43 PM, Memnarch said:

Well that's a horrible reason oO

 

As Mr. Einstein said, everything is relative.

 

The point of origin on any graphics system is a design choice made by the original developer. If you weren't there to provide input, then not only do you not get to describe their decision as 'horrible', but you have absolutely no understanding about what considerations they pondered in making that decision.

 

There are formulas for translating any coordinate system to any coordinate system - look them up if you want to make your code impenetrable. Or maybe there is even a system setting deep down in the bowels of the operating system that can define the coordinate system, kinda like you can set right to left typography. Have fun.

 

You, know, sometimes choices like this are just arbitrary, there is no reason to do it any one of several possible ways, so they just picked one. That is the important part - pick one and be consistent.

 

Sheesh.

 

 

Share this post


Link to post

Just thinking about it, its probably based on how Latin based languages are read, left to right, top to bottom.

Share this post


Link to post

Some interesting reading regarding to your post.

 

Why are bmps stored upside down?
 

https://stackoverflow.com/questions/8346115/why-are-bmps-stored-upside-down

 

So, in DIBs, the bottom row of the image is the first row of the file, and the top row of the image is the last row in the file. This is called a bottom-up organization. Because this organization is counterintuitive, you may ask why it's done this way.

Well, it all goes back to the OS/2 Presentation Manager. Someone at IBM decided that all coordinate systems in PM—including those for windows, graphics, and bitmaps—should be consistent. This provoked a debate: Most people, including programmers who have worked with full-screen text programming or windowing environments, think in terms of vertical coordinates that increase going down the screen. However, hardcore computer graphics programmers approach the video display from a perspective that originates in the mathematics of analytic geometry. This involves a rectangular (or Cartesian) coordinate system where increasing vertical coordinates go up in space.

In short, the mathematicians won. Everything in PM was saddled with a bottom-left origin, including window coordinates. And that's how DIBs came to be this way.

Source: Charles Petzold, Programming for Windows 5th Edition, Chapter 15.

Edited by Attila Kovacs

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×