Original Post
Hi guys,
i''m using directx8.
Some times ago I''ve coded a simple windowed framework
using DirectDraw.I had a GraphicalObj class from
which i derived a GraphicalEdit, GraphicalList,
GraphicalComboBox etc...
Each of these classes ridefined the abstract method
paint(Canvas* canvas) and used my Canvas draw functions.
If in a component i made a canvas->FillRect(0,0,GetWidth(),
GetHeight(),0XFFFF00); (where getwidth and height returned
the dimensions of the current control) i used the x-y origin
of the control to offset any drawing so this call resolved
to backBuffer->FillRect(GetXPos(),GetYPos(),GetXPos()+GetWidth() etc...)
Now i wanted to make the same thing work in a 3d accelerated
way with DirectX8.If i use the transformed and lit vertices
i can have the same behaviour (i can specify the screen
coords like i did with Blt in DirectDraw,ok).
But i want to go a step further.
How can I render a 3D object into one of those components?
How can I offset the origin of 3D axis of the render target
to match the x,y origin of the 2d GraphicalObject?
I think I have to move the camera but i don''t know how.
The major problem is clipping.How can I tell DirectX8 to
set the clipper to a RECT of the current render target?
The drawings inside each paint() redefinition have to
be relative to the location of the rect of the
GraphicalObj.
I want to do like the menu in UnrealTournament.
When you select a bot on the right there is the preview
of the 3d Model that is perfectly clipped in the
window where it is drawn.
Any ideas?