Point in 3d graphics

Q&A for Visual Basic, Visual Basic .NET, and PowerBasic developers using DPlot
Post Reply
guibson
Posts: 54
Joined: Wed Mar 10, 2004 9:20 pm

Point in 3d graphics

Post by guibson »

Hi, still trying to find waht is the problem. I think that we found something interesting.

If I move the mouse on the left upper corner of the graphic then the Y value for the mouse is not matching the VUR of the DPM object.

And the difference is matching the Offset.

Can you think about something for that ?

Also our graphics are good size in memory and we reduce them a lot when shown at screen. Can it be the reason why it is happening ?

Thanks !
________
DIGITAL VAPORIZER
Last edited by guibson on Fri Feb 11, 2011 10:49 pm, edited 1 time in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Also our graphics are good size in memory and we reduce them a lot when shown at screen. Can it be the reason why it is happening ?
Yes. This is related to my previous reply:
The only other thing I can think of is that the lines and symbol are drawn at the correct location and it is the bitmap that is placed incorrectly (or at least not placed as the example expects it to be). When you call DPlot_GetBitmapEx, are you using the size of the PictureBox for the requested size of the bitmap, as in:

Code: Select all

ret = GetClientRect(Picture1.hwnd, rcPic)
.
.
hBitmap = DPlot_GetBitmapEx(DocNum, rcPic.Right - rcPic.Left, rcPic.Bottom - rcPic.Top, DPM)
And if not, are you centering the bitmap within the PictureBox rather than placing it in the upper left corner? (should be the latter).
If you're using StretchBlt or some other method to compress the bitmap instead of BitBlt as in the example, then nothing will work right. The DPM members are for the actual bitmap dimensions, not a picture that has been squeezed to fit in your frame. If you really want to get a large bitmap and reduce the size for display you can probably make this work if you also scale the appropriate values in the DPM structure, though you'll most likely have roundoff errors.
Visualize Your Data
support@dplot.com
guibson
Posts: 54
Joined: Wed Mar 10, 2004 9:20 pm

Post by guibson »

Our code is matching the example sent in your reply.

I wrote in my last post :
If I move the mouse on the left upper corner of the graphic then the Y value for the mouse is not matching the VUR of the DPM object.

And the difference is matching the Offset.

Can you think about something for that ?
I made more test and I only get incorrect value for VUR with the 3D graphics.

Thanks !
________
Honda Super Cub history
Last edited by guibson on Fri Feb 11, 2011 10:50 pm, edited 1 time in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'm confused. If you're copying the example, then what did this:
Also our graphics are good size in memory and we reduce them a lot when shown at screen.
mean?

Also please check to make sure you're using version 1.9.9.1.
Visualize Your Data
support@dplot.com
guibson
Posts: 54
Joined: Wed Mar 10, 2004 9:20 pm

Post by guibson »

I'm sorry but sometimes I don't know how to translate correctly from french.

We are using BitBlt to compress the graphic
Private Sub Picture_Paint(Pic As PictureBox, hBitmap As Long)
Dim bm As BITMAP
Dim hbmpOld As Long
Dim hdc As Long
Dim hdcMem As Long
Dim Ret As Long

If hBitmap <> 0 Then
hdc = GetDC(Pic.hwnd)
hdcMem = CreateCompatibleDC(hdc)
If (hdcMem <> 0) Then
hbmpOld = SelectObject(hdcMem, hBitmap)
Ret = GetObject(hBitmap, Len(bm), bm)
Ret = BitBlt(hdc, rcPic.Left, rcPic.Top, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY)
Ret = SelectObject(hdcMem, hbmpOld)
Ret = DeleteDC(hdcMem)
End If
Ret = ReleaseDC(Pic.hwnd, hdc)
'Pic.Picture = Pic.Image
End If
End Sub
Our version for DPlotJr is 1.9.9

Thanks !
________
HONDA ST SERIES
Last edited by guibson on Fri Feb 11, 2011 10:50 pm, edited 1 time in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'm sorry but sometimes I don't know how to translate correctly from french.
There's no reason to be sorry; your English is certainly much better than my French :D
Our version for DPlotJr is 1.9.9
This is most likely the problem. Without checking the source again I think turning off the legend ( [ContourLegend(0)] ) will solve the problem in the version you have. I'll post an update to DPlot Jr late tonight that has this problem corrected.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

... and I owe you an apology. I confused you with another user that I earlier corresponded with by e-mail who had a slightly different but similar problem. The end result of that e-mail exchange was version 1.9.9.1 beta, and I assumed you had that version.
Visualize Your Data
support@dplot.com
guibson
Posts: 54
Joined: Wed Mar 10, 2004 9:20 pm

Post by guibson »

YES it's working but that is causing another problem.

Color scales on the right side of the graphic disappear.

Thanks !
:D
________
Chevrolet corvette c6.r
Last edited by guibson on Fri Feb 11, 2011 10:50 pm, edited 1 time in total.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Go here. Sorry for all the run-around. Please let me know if this doesn't fix the problem for you.
Visualize Your Data
support@dplot.com
guibson
Posts: 54
Joined: Wed Mar 10, 2004 9:20 pm

Post by guibson »

It looks like that with version 1.9.9.2 Beta the problem is fixed.

We'll post another topic if we need to.

Thank you !
________
Honda Silver Wing (scooter) specifications
Post Reply