AuthorTopic: A Matter of Perspective...  (Read 11908 times)

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: A Matter of Perspective...

Reply #10 on: March 10, 2015, 02:49:13 pm
Let me get this straight ???:

Linear projection are orthographic projections.
Rather, I would say that Orthographic projections are linear projections. That makes 'oblique is linear, but not orthographic' make sense easier.

Quote
Only, in the Ninja Gaiden screen, we're dealing with an oblique projection which is a linear projection but not an orthographic projection. Am I right so far?

dpixel's edit would be oblique projection:

While my original screen would be... orthographic projection?:

dpixel's edit is definitely oblique -- the shapes described by his lines are incompatible with orthographic projection of rectangular objects. If that was an orthographic drawing, it would describe instead a series of parallelograms.

Your original could be considered as either oblique or orthographic, since no angling is involved.

Quote
Ok, I think this is the definition I was looking for. I've saved both pictures to my hardrive by the way.

So this perspective:


...is equivalent to this one:

Yes.

Quote
While this one:

...is equivalent to this one:

No. Sorry, I don't know how to render oblique projection with blender. Those two views I rendered are *both orthographic*. The first view has the object planes aligned perfectly with the camera, the second has them differing by 22.5 degrees in one axis.

Quote
So basically, I have to choose either an oblique or orthographic projection and then stick with it, am I getting this right?
.. Up to a certain point. It's pretty common to cheat perspective for gameplay purposes -- eg LOZ:LttP (TVTropes warning).
Oblique projection just basically says out of the gate 'There's no camera, just lies and other lies.' so it gives you an excuse for the other cheats ;)

(or to put it another way: an orthographic view is a possible perspective projection from a lense with infinite distance from the scene and infinite focal distance. Oblique just isn't a possible perspective projection, it's not something you could actually see given the shapes that are implied -- it's "forced depth".)

Quote
This would be orthographic:

The image isn't orthographic (it's a photo taken with a real lense, meaning it is in perspective, probably with a degree of lense distortion involved as well)
Some objects in perspective shots may be 'close enough' to orthographic, though -- remember my comment about infinite distance? The further the camera is from the object, the closer the result is to an orthographic projection. But we are talking serious distances here generally, no less than 100m just to qualify as 'getting somewhat towards ortho'. The top plane of that roll is probably still subject to perspective distortion.

Regarding oblique, as far as I know, there are no apparatus capable of taking 'oblique photos', if that concept even makes complete sense.

Quote
My question is: based on my screen, just how much of the top should I see? What's the eye level here?
Okay, I'll stop you there, because : that's up to you. Projections are not viewpoints. there are a range of possible oblique views, there are a much larger range of possible orthographic views (on a given scene).

Oh, btw, eye level is not a thing that effects projection (except clipping the image) in orthographic or oblique projections. The horizon is technically present but infinitely distant. Moving around the centre of the camera is directly equivalent to panning through the projected 2d image -- no angles or lengths ever change as a result.

The only meaningful parameters for orthographic projection are rotation (the three angles specifying the camera plane's orientation in 3d space).
For Oblique, correct me if I'm wrong, it has only two parameters: angle on the 2d plane, and ratio aka 'depth'.
Ratio describes the length of projection for a hypothetical cube of space.
Looking at dpixel's edit, we can work out the approximate ratio in use:

* One cube of space appears to be 27x27 along the front face, based on the spacing of the divisions.
* The upper face has a length of about 6. (sqrt(3*3 + 5*5) = 5.83, or sqrt(3*3 + 6*6) = 6.7, according to where you think it's correct to measure to. I took the average which is 6.26)
* Therefore the ratio is 6/27, which is 0.222222; or more precisely 6.26 / 27, which is 0.231



However, the problem here is actually one of relative size.

You have indicated the size of a block in your existing work. What is a block's shape in 3d? Is it a cube? Is the toilet roll supposed to occupy the same amount of space as said cube, or a multiple of it (ie, be a cylinder with length equal to diameter)?

If so, the answer is simple: The ellipse that fits exactly into your existing top surface.
Here's my impression of that, with the existing colors which are rather lacking for this:


If this is the wrong scale, then just multiply the sizes of the top surface and re-fit the ellipse to that. That's all I can say for now, I need to get to bed.

EDIT:
So to rephrase that, you need to decide the dimensions of your base unit (assumably that platform block), and the dimensions of your toilet roll. Then you can calculate the ratios between those dimensions,  and you will have the information necessary to scale the two visible faces of your block. These scaled faces will exactly indicate the space that the toilet roll occupies, including how much of the top is visible. You can then fit the necessary ellipse onto the scaled top face and extrude a cylinder from it (assuming you want the toilet roll to be axis-aligned with other objects).

EDIT2: cleaned up some stuff and improved my understanding of oblique projection.
« Last Edit: March 11, 2015, 05:58:24 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline dpixel

  • 0010
  • *
  • Posts: 303
  • Karma: +1/-0
    • http://pixeljoint.com/p/20306.htm
    • View Profile

Re: A Matter of Perspective...

Reply #11 on: March 10, 2015, 03:11:40 pm
Interesting conversation here.

I think one of the rules should be:  If the screen will scroll (which in your case looks like it will),  than there shouldn't be a vanishing point unless rendering in 3D with openGL or something.

The rest would be up to you as how much of the top of stuff will be visible and how much of a side of stuff will be visible. And then keep it consistent.

EDIT:
Added cones in my edit:


Also, your toast man character is almost the exact same perspective projection as my edit.  I also had the shadows backwards on the platforms in my last edit.

allowed myself to edit this mistake. ~mou
« Last Edit: March 10, 2015, 04:17:58 pm by Cyangmou »

Offline Cyangmou

  • 0011
  • **
  • Posts: 929
  • Karma: +3/-0
    • cyangmou
    • http://pixeljoint.com/p/32234.htm
    • cyangmou
    • View Profile
    • Pixwerk Homepage

Re: A Matter of Perspective...

Reply #12 on: March 10, 2015, 04:08:18 pm
Let me get this straight ???:

Linear projection are orthographic projections. Only, in the Ninja Gaiden screen, we're dealing with an oblique projection which is a linear projection but not an orthographic projection. Am I right so far?

dpixel's edit would be oblique projection:


While my original screen would be... orthographic projection?:



Both examples are Parallel projections (more or less - there are inconsistencies)

Dpixels is a general oblique projection,
but neither cabinet, nor cavalier - and it's unclear if the axis got scaled (since the plaform wasn't edited).
http://cs.brown.edu/stc/summer/viewing_history/viewing_history_23.html

yours is very close to axonometric, but the floor heights aren't consistent.

If we talk about parallel projections, we look at the scaling of the axis.

axonometry requires a proportional scaling of all axis.
(isometry usually is an axonometry)

Orthogonal means, that there are 2 unscaled lengths (usually width and height) and one arbitrary scaled length (usually depth)
Quote
In mathematics, orthogonality is the relation of two lines at right angles to one another (perpendicularity)...
http://en.wikipedia.org/wiki/Orthogonality

The ninja Gaiden screenshot actually is a mashup out of parallel projections and perspective -
I personally would refer to it as "a 2.5d case" because I lack a better term (not to confuse with game art 2.5d) 

It's not true 3d (with correct applied perspective) and neither it is a correct projection with affinely warped planes.
In fact it's a complete weird fantasy if it comes down to projection and perspective - but hey somehow it works and doesn't look too bad (wonder which actual non-artist experienced with perspective can see right away how far it's off)


Here is a chart with correct changes and notes for better understanding:

« Last Edit: March 10, 2015, 04:13:47 pm by Cyangmou »
"Because the beauty of the human body is that it hasn't a single muscle which doesn't serve its purpose; that there's not a line wasted; that every detail of it fits one idea, the idea of a man and the life of a man."

Dev-Art
Twitter

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: A Matter of Perspective...

Reply #13 on: March 11, 2015, 03:49:57 am
FWIW I've just dug up this, which seems to demonstrate that oblique projections (at least cavalier projection) are equivalent to doing orthographic projection and then skewing+stretching the resultant image.

There's also a rather interesting technique using a Lattice transform to non-destructively deform an object so that, when rendered with an orthographic projection, it appears as if it were rendered with an oblique projection. I believe this is adjustable to any oblique projection angle, not just cavalier (which is 45 degrees).
 This may be getting too Blender-specific, but it would allow you to get reference points for a range of generic solids.

EDIT: Looks like that works -- here is an album comparing oblique to ortho.
I'm a novice with oblique projection, so hopefully these results look correct to more experienced people.
I'll post the two wireframes -- oblique and ortho:

Oblique: (edit: fixed)


Ortho:


The album also includes solid renders.
« Last Edit: March 11, 2015, 06:38:48 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline hawken

  • 0010
  • *
  • Posts: 214
  • Karma: +0/-0
  • 8bit fantasy
    • hawkun
    • View Profile
    • my portfolio

Re: A Matter of Perspective...

Reply #14 on: March 11, 2015, 05:30:40 am

This would be orthographic:


best post on WOTP 2015  ;D

And yes it would, if taken from far enough away. It's almost Oblique, almost Isometric.

Wikipedia has tons of articles on this subject, but in a nutshell, Orthographic is simply flat projection, a camera with no perspective.
In games this is often:
  • parallel to the horizontal = Orthographic 2D
  • +45 degrees perpendicular to the horizontal(x of camera facing y) = Oblique projection.
  • +45 degrees perpendicular to the horizontal, any rotation on the vertical(z) = Oblique projection.
  • +45 degrees perpendicular to the horizontal, skew entire depth of view by any degree along the x  = Oblique projection. (biggest point of contention), and not possible by most game engines without extensive scripting
  • +35.264 perpendicular to the horizontal and 45 degrees on the vertical(z) = Isometric
  • +30 perpendicular to the horizontal and 45 degrees on the vertical(z) = Dimetric 
Dimetric = pixel art Isometric (two px across, one px up)

In 3D, Y is often depth and Z is height, this can get confusing, because the 2d plane is laid out horizontally. In 2D co-ordinates though X is horizontal and Y is vertical, because the 2d plane is laid out vertically. Its a debate that will never end.

projections in video games
classical projections

What you seem to be after is Oblique with Perspective.

But Oblique is Orthographic, and Orthographic doesn't have perspective! Quick someone call M. C. Escher!

So how did they make Ninja Gaiden then? The answer is simple:

They didn't give a flying fXXk!

« Last Edit: March 11, 2015, 06:10:30 am by hawken »
twitter: https://twitter.com/hawkun
Pirate Pop Plus for 3DS, WiiU & Steam!

Offline hawken

  • 0010
  • *
  • Posts: 214
  • Karma: +0/-0
  • 8bit fantasy
    • hawkun
    • View Profile
    • my portfolio

Re: A Matter of Perspective...

Reply #15 on: March 11, 2015, 05:59:11 am
Oblique:


This is something else... everything looks distorted. Your cones turn into pyramids.
twitter: https://twitter.com/hawkun
Pirate Pop Plus for 3DS, WiiU & Steam!

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: A Matter of Perspective...

Reply #16 on: March 11, 2015, 06:07:52 am
This is something else... everything looks distorted. Your cones turn into pyramids.

Heh, that was one of the three reasons I thought that it was probably correct oblique:

☑ cubes are correctly skewed
☑ everything else is matchingly skewed
☑ rounded surfaces look pretty fucked up

Anyway, I think the lattice effect was being inappropriately clipped. Scaling it up yields this:



Does this seem more correct to you? It certainly makes more sense to me.
I've updated the album and my post above on the provisional assumption it is correct.
« Last Edit: March 11, 2015, 06:40:13 am by Ai »
If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.

Offline Zizka

  • 0010
  • *
  • Posts: 498
  • Karma: +0/-0
  • Keep on smilin'
    • View Profile

Re: A Matter of Perspective...

Reply #17 on: March 11, 2015, 07:22:45 pm
Quote from: ai
So to rephrase that, you need to decide the dimensions of your base unit (assumably that platform block), and the dimensions of your toilet roll. Then you can calculate the ratios between those dimensions, and you will have the information necessary to scale the two visible faces of your block. These scaled faces will exactly indicate the space that the toilet roll occupies, including how much of the top is visible. You can then fit the necessary ellipse onto the scaled top face and extrude a cylinder from it (assuming you want the toilet roll to be axis-aligned with other objects).

That's a good rule of thumb, thanks.

Quote from: dpixel
I think one of the rules should be:  If the screen will scroll (which in your case looks like it will),  than there shouldn't be a vanishing point unless rendering in 3D with openGL or something.

The rest would be up to you as how much of the top of stuff will be visible and how much of a side of stuff will be visible. And then keep it consistent.

That's a good pointer too.

In your edit with the cones:

The parallel at the base of the cone are parallel to the ones of the floor.

The way I understand it, if there was a vanishing point, the cone itself wouldn't look like in your edit. If there was a VP, the cone would be standing straight. It's perspective would change depending on the location of the VP.

Am I right about this?

@Cyangmou:
Thanks for the pic, saved it on my laptop. Will come in handy.

Quote from: mou

To sum things up: both of those are parallel projections. More specifically, they are orthographic projections. Even more specifically, the second one is axonometric.


If I wanted to use the 2.5D to build my tileset... how would I pull it off? Since a VP is implied, this would that I would need to create many versions of the same tiles with various angles depending said tile is in relationship with the VP. Seems like a chore to me.

(if you still have the photoshop file, could you provide a black background so the text is easier to read. I tried to do so in photoshop but the font end up looking fuzzy).



The cavalier perspective seems the best bet for my game. How can I determine at what angle I should draw the slopes like you did?

If I were to use a cylinder using that projection:


How can I know the shape of the top ellipse of my cylinder? Do I just need to calculate the ratio of my basic cube and then apply that ration to my cylinder to determine the shape of the ellipse? But then, how do I apply this ratio? It's not like a cube with a single straight line to separate the side from the top...  ???

Should I just put #3 on the floor, make it fit with it and use the same ellipse on the floor I would use on the top? Or should I use #1 or #2 for the top?

If the toilet roll is on its side like this:


Should I just draw a perfect circle and then have a 45 degrees angle at #1 and #2 to draw the rest?

@Hawken: Thanks for the links. I've downloaded both.

I need clues/pointers to know how to draw my shapes in space.

I don't know for everyone else, but I'm about as confused as I was at first.  ???

Offline dpixel

  • 0010
  • *
  • Posts: 303
  • Karma: +1/-0
    • http://pixeljoint.com/p/20306.htm
    • View Profile

Re: A Matter of Perspective...

Reply #18 on: March 11, 2015, 07:41:32 pm
Quote
The way I understand it, if there was a vanishing point, the cone itself wouldn't look like in your edit.
Correct.
Quote
If there was a VP, the cone would be standing straight. It's perspective would change depending on the location of the VP.

Am I right about this?
I'm not sure what you mean about standing straight, but yes the shape of the cone would change if there was a VP.

Quote
I don't know for everyone else, but I'm about as confused as I was at first.
It can be confusing especially when you just want to pixel.  But it's good to learn some fundamentals if you're going to do a whole game in a certain view.

Offline Cyangmou

  • 0011
  • **
  • Posts: 929
  • Karma: +3/-0
    • cyangmou
    • http://pixeljoint.com/p/32234.htm
    • cyangmou
    • View Profile
    • Pixwerk Homepage

Re: A Matter of Perspective...

Reply #19 on: March 11, 2015, 08:39:59 pm
Image with darker text and white bg - should be uploaded at 100% size and sharp pixels, if anyone sees it differently, it#d be interesting to know why (make sure you checked your browser zoom)




@Cyangmou:
Quote from: mou

To sum things up: both of those are parallel projections. More specifically, they are orthographic projections. Even more specifically, the second one is axonometric.

yes, yes, yes

graphical projection < parallel projection < ortographic/orthogonal projection < axonometic projection

You start with perspective, apply certain rules to it and all those cases have a special name.

Quote
Parallel projection corresponds to a perspective projection with an infinite focal length (the distance from the image plane to the projection point), or "zoom".

Quote from: Gary R. Bertoline et al. (2002) Technical Graphics Communication. McGraw-Hill Professional, 2002. ISBN 0-07-365598-8, p.330.
Axonometric projection is a type of parallel projection used for creating a pictorial drawing of an object, where the object is rotated along one or more of its axes relative to the plane of projection.


If I wanted to use the 2.5D to build my tileset... how would I pull it off? Since a VP is implied, this would that I would need to create many versions of the same tiles with various angles depending said tile is in relationship with the VP. Seems like a chore to me.

You make decisions based on what looks alright and works well together with your tile restrictions and your gameplay.
THe outcome is not a clean projection, it's something weird and inconsistent - like Ninja Gaiden it will be "broken" in a purely technical sense.
You just don't care about "correct 3d", because your tile restrictions or time limitations are more important. 


The cavalier perspective seems the best bet for my game. How can I determine at what angle I should draw the slopes like you did?

A perspective requires perspectivical scaling - this means that you have to add vanishing points.
If you add vanishing points, it's also no longer a parallel projection.


The cavalier "perspective" is a projection.
It's the cavalier projection.

The cavalier projection is a very special case of an oblique projection with it's own rules.
THe rules are:
width and height have an angle of 90
depth is at an angle of 45 to the horizontal line
a length which has a length of 1 in width, has a length of 1 in height and a length of 1 in depth (actually at 45)

if you talk of "slopes" i think you mean the elevation angle and not the depth angle.
The elevation angle was just an assumption, it can be any angle.
I just went with a 2:1 clean pixel line for the slopes.


http://cs.brown.edu/stc/summer/viewing_history/viewing_history_23.html


If I were to use a cylinder using that projection:


How can I know the shape of the top ellipse of my cylinder?

You take the ruleset of the cabinet projection and construct an ellipse.
Make sure that you don't draw a circle. The ellipse is affected by the projection as well.

look at this - that's how a circle appears at a top-plane in cavalier projection:


Should I just put #3 on the floor, make it fit with it and use the same ellipse on the floor I would use on the top? Or should I use #1 or #2 for the top?

if you want to have a cavalier projection bottom and top circle are the same.
it's not #3 because the ellipse would appear differently
If you want to fake perspective, you are producing just a graphical projection and you can go with #1 or #2

If the toilet roll is on its side like this:

Should I just draw a perfect circle and then have a 45 degrees angle at #1 and #2 to draw the rest?

It would be a circle.
If you want to have a cavalier projection, the front plane isn't distorted (therefore a circle).
the 45 lines are also right (but that also just depends if it's a cavalier projection - keep the ruleset in mind)

« Last Edit: March 11, 2015, 09:03:25 pm by Cyangmou »
"Because the beauty of the human body is that it hasn't a single muscle which doesn't serve its purpose; that there's not a line wasted; that every detail of it fits one idea, the idea of a man and the life of a man."

Dev-Art
Twitter