Perspective options


#1

So I’ve been playing around with rotations of objects and was wondering if there’s a possibility to add ‘perspective’ adjustments to an object. I’m not sure how object rotations (camera) is currently implemented, but I’d love a ‘global’ camera option - as it is now, and then the ability for an object to have it’s own local perspective. + an ability to switch to an isometric camera.

An example:
I currently have a 400x400 px screen and a 100x100 rectangle. If the rectangle is off centre on screen and I rotate on the X axis it’s perspective is towards the centre. This I’m calling ‘global’ perspective above, since if I have more rectangles all of their perspective is towards the centre of screen.

On a local perspective I’d have each object’s perspective be the Pivot point of the object (but in distance). I guess in this case I’d like to add a ‘perspective amount’ adjuster.

All in all I’d rather have 3d support in Noodl than this, but I thought I’d add this too for 2d objects :slight_smile:


#2

Makes sense. “Perspective amount” could be useful both for global and local perspectives.

I’m really interested in what you would use a isometric perspective for, I’ve only seen it in the context of games like civilization or diablo :slight_smile:

Fun fact, if you switch from WebGL to Canvas 2D you will get an orthographic perspective due to the limitations of the Canvas API. Noodl does all the 3d matrix calculations, but the Canvas 2D api only accept 2d matrices.


#3

I guess Canvas 2d does take care of the isometric perspective. I don’t remember why I didn’t want to use it at the moment, but it was something else that it was doing to the canvas that made me go with WebGL. Perhaps it was something to do with clipping or something similar… Will try to dig up the sample :slight_smile:

Thanks again!