Re: How Text in 3d space?
- From: "Amrit" <smukunda@xxxxxxxx>
- Date: Wed, 9 Nov 2005 08:59:13 +0545
Thanks
I am filling Greate now.
Thanks a lot both of you for your greate suggestion.
Amrit
"vbexp" <nobody@xxxxxxx> wrote in message
news:eipnYR04FHA.2616@xxxxxxxxxxxxxxxxxxxxxxx
> You could use GetGlyphOutline() to get a specific character outline, then
> use the data to transform it or stretch it in any way you like.
>
> GetGlyphOutline:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext
_52at.asp
>
> KB Search result:
>
http://support.microsoft.com/search/default.aspx?mode=s&query=GetGlyphOutlin
e
>
> How To Draw TrueType Glyph Outlines
> http://support.microsoft.com/default.aspx?scid=kb;en-us;243285
>
> GetGlyphOutline() Function Demonstration
> http://support.microsoft.com/default.aspx?scid=kb;en-us;97340
>
> The KB above includes a downloadable sample that has a help file that
gives
> a good introduction.
>
> How To GetGlyphOutline() Native Buffer Format
> http://support.microsoft.com/default.aspx?scid=kb;en-us;87115
>
> Note: all the KB articles list above are from the KB search result above.
>
> The basic formulas that I use to transform a 3D point to 2D point are
below.
> You will have to make your own handling for hidden surfaces, partial
hidden
> surfaces, etc., or just use DirectX instead. It's virtually part of the OS
> now. Search the web and newsgroups in how to use it. There is a dedicated
> newsgroup for it here:
>
> news://microsoft.public.vb.directx
>
> Here is the function that I developed and used:
>
> Private Type My2dPoint
> x As Double
> y As Double
> End Type
>
> Private Type My3dPoint
> x As Double
> y As Double
> z As Double
> End Type
>
> Private Function Get2dPoint(ByRef p3d As My3dPoint) As My2dPoint
> ' L = Distance from screen to the user in the same unit as the input.
> ' It's not necessary to turn this into a variable, just use a
> ' typical value.
> Const L As Double = 1536 ' User is at 1536 pixels away from monitor
> Dim p2d As My2dPoint
> 'Dim temp As Double
>
> ' Fast formula, less accurate, objects don't become smaller as they go
> ' right or left, but become smaller and larger as the go backward or
> ' forward.
> 'temp = p3d.z + L
> 'p2d.x = p3d.x * L / temp
> 'p2d.y = p3d.y * L / temp
>
> ' Accurate slower formula
> p2d.x = p3d.x * L / Sqr((p3d.z + L) ^ 2 + p3d.y ^ 2)
> p2d.y = p3d.y * L / Sqr((p3d.z + L) ^ 2 + p3d.x ^ 2)
>
> Get2dPoint = p2d
> End Function
>
>
>
> "Amrit" <smukunda@xxxxxxxx> wrote in message
> news:%23EnBZtz4FHA.3276@xxxxxxxxxxxxxxxxxxxxxxx
> > Thank you for help Mike.
> >
> >
> >
> > Yes I want to create 3d engine for to draw all. It include all feature
> > etc.
> >
> > Could you possible to suggest me which book is good for me to take
> > reference
> > for complete 3d programming, rendering, modeling, modify.
> >
> >
> >
> > Where can I find IMO? Is it free?
> >
> > Thanks for Help
> >
> >
> >
> > "Mike D Sutton" <EDais@xxxxxxxx> wrote in message
> > news:uQmsGls4FHA.3588@xxxxxxxxxxxxxxxxxxxxxxx
> >> > How to draw 2d Text in 3d space in pure VB? (With out DirectX, OpenGL
> > and
> >> > any other engine.) Is there any reference for it? And if I have to
make
> > 3d
> >> > text how do I make it?
> >>
> >> GDI has no native support for 3D space so you would need to work out
the
> > mathematics of 3D projection yourself. Once
> >> you've done that then to actually draw in 3D you would work out the
> > projected points for the bounding rectangle
> >> surrounding the drawing and linearly interpolate your 2D data into that
> > area. In the case of BitBlt() where you're
> >> drawing pixels, you would iterate through pixels on the target buffer
and
> > map those back to 2D coordinates on your
> >> source image (this would avoid massive overdraw when scaling down or
> > 'holes' when scaling up. For text then as long as
> >> you're using a TrueType or OpenType font then you could get the font
> > outlines by drawing the text within a path bracket
> >> and re-mapping those to your 3D projected parallelogram.
> >> Of course 3D also brings up more issues such as z-buffering, depth
> > fogging, texturing and lighting, culling etc which
> >> you may or may not choose to support.
> >> At the end of the day IMO it's far easier to simply use a 3D library in
> > which these issues have all been implemented and
> >> will utilise 3D hardware where available.
> >> Hope this helps,
> >>
> >> Mike
> >>
> >>
> >> - Microsoft Visual Basic MVP -
> >> E-Mail: EDais@xxxxxxxx
> >> WWW: Http://EDais.mvps.org/
> >>
> >>
> >
> >
>
>
.
- References:
- How Text in 3d space?
- From: Amrit
- Re: How Text in 3d space?
- From: Mike D Sutton
- Re: How Text in 3d space?
- From: Amrit
- Re: How Text in 3d space?
- From: vbexp
- How Text in 3d space?
- Prev by Date: help me
- Next by Date: Logical window to viewport mapping
- Previous by thread: Re: How Text in 3d space?
- Next by thread: Re: How Text in 3d space?
- Index(es):
Loading