No, that’s not exactly what I want to do !
I have a 3D World viewed in Perspective. I can freely walk in this world. What I want is that some specific objects keep the same size wherever the viewer is (I don’t want them to be affected by the perspective).
Well, I have found a solution but I wonder how 3DSMaxR3 does it…
I’ll explain a little…
In my program, I have got a tree with all the objects.
Basically, I render a scene with calling :
Which in turns will render everything…
For each object, I use :
I have got several objects all derived from a class called C_M3D_Entity which contains all positional stuff… The Render() member is virtual.
For my specific objects mentioned above, I have added this code to the Render function (which is called after SETPOSITION !) :
And it works pretty well…
For those who wonder what the hell an HGL_Vector3Df is, it’s just one of the objects available in my library (HeavenGL… Stupid name, I know but I am a coder, not a writer !).
So basically, for those objects, I retrieve the distance that separate them from the viewer (N in the code) and I scale of a number d=1+N/5000 (the 5000 is totally arbitrary : it depends on the size I want for the objects)…
Well, that was a bit long but now I’d be interested in some comments on this method ! (and not on the name of the library, please ! )