Then your on the wrong forum absolutely no opengl stuff in mel, just maya node manipulation! Mel is not that kind of language its just a journaling language (however image planes can wirte z depth and act on z depth! theorteticaly one plane is enough). Besides you will want to draw on a overly pane instead. But thats api stuff. Read the custom image plane example in the devkit should have all you need for this.
Amway the coordinates are in camera space so if you move the planes the same way (one would think that would be self evident for anybody who can make opengl). So yes nodes can do this but you shouldnt bother as image plane is fsuperior in all regards. SO DONT USE FOLLOWING
CODE
// dont use this tough
file -f -new;
polyPlane -ch on -o on -ax 0 0 1 -sw 1 -sh 1 -w 10 -h 10;
parent -relative pPlane1 persp;
polyPlane -ch on -o on -ax 0 0 1 -sw 1 -sh 1 -w 10 -h 10;
parent -relative pPlane2 persp;
setAttr "persp.visibility" 1; //so you can see it
createNode multiplyDivide;
connectAttr -f perspShape.nearClipPlane multiplyDivide1.input1X;
connectAttr -f perspShape.farClipPlane multiplyDivide1.input1Y;
setAttr "multiplyDivide1.input2X" -1;
setAttr "multiplyDivide1.input2Y" -1;
connectAttr -f multiplyDivide1.outputX pPlane1.translateZ;
connectAttr -f multiplyDivide1.outputY pPlane2.translateZ;
Amway what you want is (swap this for your custom image plane!):
CODE
//use this instead
file -f -new;
createNode imagePlane;
createNode imagePlane;
cameraImagePlaneUpdate perspShape imagePlane1;
cameraImagePlaneUpdate perspShape imagePlane2;
connectAttr -f perspShape.nearClipPlane imagePlane1.depth;
connectAttr -f perspShape.farClipPlane imagePlane2.depth;
Altough granted some display cards do not draw image planes right but thats the hardware drivers fault not mayas.
But i do suggest you use one plane! See maya can use zdepth data in the planes as of 8.5 so if you make iff image and say use z depth maya automatically integrates stuff at right zdepth. So one plane should be enough!
PS: dure to numeric inaccuracy i do suggest you set a plus minus average node between the planes and your clips because otherwise they might clip away randomly.