View Single Post
Old 12-06-2014, 03:51 AM
dotnetwrassler dotnetwrassler is offline
Join Date: Sep 2014
Location: USA (Pacific/West Coast)
Posts: 71
Default boops boops joins the thread (with an attachment)!

Thanks for posting boops boops.

Text undergoing warped transform as a graphics path - wow.
That's something I never would of though of...

The way the tint shaded from the cube's back plane shows through the text outlines is really interesting as well.

The perspective mapped text outlines would make for some nice HUD (Heads up display) labeling in a 3D game.

The issue with the text being backwards can probably be correct with some kind of
transform(s) probably...but I really don't understand how they work even with passel's help a few posts back.

Speaking of which...
I had trouble getting passel's code suggestions to work, because the value of
pbt (as I stepped through the code) kept coming up as -1
in this line:
pbt = b + ((pbhpx / pbwpx) * w)
which then caused an error in this line:
e.Graphics.ScaleTransform(pbwpx / 100.0F, -pbhpx / pbt)
So I fiddled around with it and finally came up with a magic number (without knowing why it works):
Sub init3d(ByVal l As Single, ByVal b As Single, _
              ByVal w As Single, ByVal z As Single, ByVal vpoff As Single)
    'pbt = b + ((pbhpx / pbwpx) * w)
    pbt = 1000
End Sub
I also wanted to try and get an addition perspective map grid oriented vertically.
The screenshot below was the best I could come up with (produced from the working multiple perspective mapping code zip attached below).
Maybe someone can steer me to the right transform(s) code?

What should be happening:
The red perspective map should align vertically with the center of the window (going from the top edge of the blue perspective lines
to the top of the window --instead of pinching off
at the center and narrowing toward the vanishing point/plane).

It would also be nice if it could extend fully in 3D space,
so half the red perspective plane is above the blue perspective plane and
half below it (right now the whole red perspective plane
is position above the blue perspective plane in 3D space).

I want the two planes to form two axes perpendicular to each other to figure out
the correct 3D mapping point for the quad distortion texture mapping of 3 walls and a floor.
One wall would be in the back and the other two walls would slant inward to meet it from the left and the right side.
The floor plane, of course, would intersect all three walls at the bottom (in a trapezoidal shape).

Last (but not least) I also throw in a working screenshot of some C# code I'm trying to do a VB.Net translation of ---remember I
mentioned in my last post about a cube made from planes of 3D dots.

I managed to clear all the errors from the VB.Net version, but the SetPixel routines
(connected with the FastBitmap class) just aren't showing up any graphics for some reason????

I know the Form Paint event is corrected hooked into the
because the screen does execute a g.FillRectangle correctly.
I also know the FastBitmap is creating the bitmap properly
(otherwise I'd be getting a big red "X" on the DrawImage flip graphics call).

Both working and non-working code are zipped together and attached below if anyone is interested.

Last edited by dotnetwrassler; 12-06-2014 at 04:11 AM.
Reply With Quote