POV-Ray : Newsgroups : povray.advanced-users : Extract 2D screen coordinates from 3D : Re: Extract 2D screen coordinates from 3D Server Time
24 Apr 2024 22:14:32 EDT (-0400)
  Re: Extract 2D screen coordinates from 3D  
From: Melody
Date: 18 Jan 2020 17:05:01
Message: <web.5e237f71c5d107b39da690110@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
> > where's my mistake? Is there a bug in the macro or in my code ?
> >
> > if you have any ideas...
> > thanks
> >
> > --
> > Kurtz le pirate
> > Compagnie de la Banquise

> regards, jr.

I have done it, it's not easy. There are two ways; data readout at same screen
xy always, no mater where you're looking,
2:
labels on objects, no matter where you're looking. here's lunar label from the
planetarium --- stuff like this requires writing some matrix functions,

#local vl = vlength(Lunar_v-campos)/88;
#local camup = <cameramatrix[4],cameramatrix[5],cameramatrix[6]>;
#local pnt = -camup*(IDS(EarthRad * 0.2724*1.05)+vl*FontSize)+Lunar_v;
#local eye = vnormalize(pnt-campos);
object {
    text {
      ttf "Arial.ttf" "Moon" 1 0
      texture {  pigment { rgb 1 }  finish { ambient 1 diffuse 0 } }
    }
    translate x*(strlen("Moon")*-0.28)
    #if (vlength(campos) < 10000) scale <vl*FontSize,vl*FontSize,vl*FontSize>
    #else scale
<vl*FontSize,vl*FontSize,vl*FontSize+0.009*(vlength(campos)/150000)>
    #end// adjust text if blurry or breaking up
    popmatrix(vcross(camup,eye),vcross(eye,vcross(camup,eye)),eye,pnt)
    no_shadow
}
#macro popmatrix(A, B, C,T)
   transform {
      matrix <A.x, A.y, A.z,
              B.x, B.y, B.z,
              C.x, C.y, C.z, T.x, T.y, T.z>
   }
#end


huge distances was a problem, stick around home and u should be fine
text.pov is a heads up display for the lego plane. ... hmm where to put it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.