Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Quad projective. #4

Closed
finscn opened this issue Aug 3, 2017 · 13 comments
Closed

About Quad projective. #4

finscn opened this issue Aug 3, 2017 · 13 comments

Comments

@finscn
Copy link
Contributor

finscn commented Aug 3, 2017

2017-08-03 11 59 35

the right-bottom point is not fixed at the right-bottom red rect. Why ?

And When use the normal method with matrix 4*4 , the result is not as same as the method in http://reedbeta.com/blog/quadrilateral-interpolation-part-1/

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Aug 3, 2017

Because you've made one of points inside the triangle of others. So I fix three points, and if fourth is bad i either ignore it, either show something that follows the formulae.

@jonlepage
Copy link
Contributor

i also nitice this issu !
GitHub Logo
@ivanpopelyshev thank for your awsome work !

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Aug 3, 2017

That's not an issue. That's my policy in case shit happens: "three point must stay, fourth can go". That's projective mapping for you. May be I'll have another solution that is better than projective and bilinear :)

@jonlepage
Copy link
Contributor

jonlepage commented Aug 3, 2017

I am not at this stage of programming.
But I will like to integrate your plugin with my introduction.
I use the core of rmmv

Ideally I would like to add a EventListener
Which according to the position of the mouse, the background will make a projection .

I never have trying integrating modules into rmmv, but if you have good tutorial?.
Sample of my game engine now ,
https://www.youtube.com/watch?v=7-DUC_uMIbs

You can see the avatar follow mouse, but i would like to make this allow Quad projective on background.
ex: sun center, and allow projection when mouse hover xy

@ivanpopelyshev
Copy link
Collaborator

Ask @Dairnon

@Dai696
Copy link

Dai696 commented Aug 5, 2017

If your trying to add a module into MV, easiest way is to just add it to the index.html in your projects main directory (where the Game.rpgproject is)

You'll notice inside the index.html there are script tags

<script type="text/javascript" src="js/libs/pixi.js"></script>

An example of me integrating pixi-ui and pixi-layers.
uxnekaw

All you have to do is add another that links you to pixi projection.

So you'd add something like
<script type="text/javascript" src="js/libs/pixi-projection.js"></script>
And then add pixi-projection into your js/lib folder.

Edit* As for your mouse issue, you can look at the code Ivan provided in the pixi.js examples for projection. You should be able to easily copy that code, tho eventListeners / button stuff won't work with vanilla RPGMaker MV now until the next update... or... if you make a plugin fixing the issue yourself...

Vanilla RPGMV layers canvas elements on top of the game canvas, preventing pixi's button features from working right. Add this to a plugin


(function(){
Graphics._updateVideo = function () {
    this._video.width = this._width;
    this._video.height = this._height;
    this._video.style.zIndex = 2;
    this._video.style.pointerEvents = "none";
    this._centerElement( this._video );
};

Graphics._updateUpperCanvas = function () {
    this._upperCanvas.width = this._width;
    this._upperCanvas.height = this._height;
    this._upperCanvas.style.zIndex = 3;
    this._upperCanvas.style.pointerEvents = "none";
    this._centerElement( this._upperCanvas );
};
})()

This will enable button stuff to work. You can test this out by adding

this.interactive = true;
this.buttonMode = true;

to the Sprite_Character

@jonlepage
Copy link
Contributor

jonlepage commented Aug 5, 2017

@Dairnon
thank is so very simples.
It was not that simple with PIXIMULTISTYLES, I had to create a new full-fledged source code of over 600 lines.
Delighted that the integration of this module is so simple and easy !
I will see if I will be able to adjust my debugger with this picture system.
https://youtu.be/iIAX-NIPlxo

@finscn
Copy link
Contributor Author

finscn commented Aug 5, 2017

Where could I find the source of pixi-layers ?

@ivanpopelyshev
Copy link
Collaborator

@finscn
Copy link
Contributor Author

finscn commented Aug 5, 2017

In the future , the layers branch will replace the master branch of pixi-display ?

@ivanpopelyshev
Copy link
Collaborator

yes

@Dai696
Copy link

Dai696 commented Aug 5, 2017

@djmisterjon I see why you had to re-write it, it was written in typescript. I would like to point out tho that instead of needing to re-write the entire thing, you could have compiled it into regular javascript, then imported that the normal way. (I think you made it harder for yourself xD)

Tho looking at the examples for it, it seems the developer already has a compiled version which would work (but it doesn't appear to be publicly showing in github for some reason)

You could just download the project, run npm on the folder via console, then run npm -i, then run the build script for it.

Something like npm build

Edit* Whenever working with other libraries try checking out the package.json. Inside you'll almost always find a scripts: section. And there should be a build command you can use to compile it. You use npm to run the command (after installing everything within the dependencies via npm -i)

@jonlepage
Copy link
Contributor

jonlepage commented Aug 5, 2017

@Dairnon yes i was try to convert it
https://www.typescriptlang.org/play/
However the performance was not at the Appointment, the code was rather poorly optimized.
So I as simply rewrite new code with my performance requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants