Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.07.16;
Скачать: CL | DM;

Вниз

GLScene - GLPortal и GLFreeForm   Найти похожие ветки 

 
Conferno   (2005-11-13 22:03) [0]

Привет мастерам!
Вот, кое-что вычитал из GLSceneFaq"a про порталы.
Пробовал так, как написано, но желаемого результата не получил....
Может кто разберется в коде, портал - вещь незаменимая для модели
уровня(например, закрытого помещения).
Вот то, что я вычитал:

Essentially level rendering, there is a small demo on it that shows a (very)
small subset of what it can do. Lacks decent importers/level editors.

Eric
/////////////////
Can I use portals to render big scenes loaded from files? Loading from
file doesn"t work because the loaders don"t create the Sectors and Polys
 instead of MeshObjects and FaceGroups. So I tought a convertion
function could do the trick. What I got is this:

procedure convert(mesh: TGLBaseMesh; portal: TGLPortal);
var
i, j: integer;
sector: TSectorMeshObject;
mo: TMeshObject;
poly: TFGPolygon;
fc: TFaceGroup;

begin
     for i:= 0 to mesh.MeshObjects.Count -1 do begin
          mo:= mesh.MeshObjects[i];
          sector:= TSectorMeshObject.CreateOwned(Portal.MeshObjects);
          sector.Vertices.assign(mo.Vertices);
          sector.Normals.Assign(mo.Normals);
          sector.Visible:= mo.Visible;
          sector.TexCoords.Assign(mo.TexCoords);
          sector.LighmapTexCoords.Assign(mo.LighmapTexCoords);

          sector.Colors.Assign(mo.Colors);
          sector.Mode:= mo.Mode;
          sector.RenderingOptions:= mo.RenderingOptions;

          //sector.FaceGroups.Assign(mo.FaceGroups);
          for j:= 0 to mo.FaceGroups.Count -1 do begin
               poly:= TFGPolygon.CreateOwned(sector.FaceGroups);
               fc:= mo.FaceGroups[j];
               poly.MaterialName:= fc.MaterialName;
               if fc.InheritsFrom(TFGVertexIndexList) then with

TFGVertexIndexList(fc) do begin
                    poly.VertexIndices.Assign(VertexIndices);
                    poly.Mode:= Mode;
               end;
               if fc.InheritsFrom(TFGVertexNormalTexIndexList) then
with TFGVertexNormalTexIndexList(fc) do begin
                    poly.NormalIndices.Assign(NormalIndices);
                    poly.TexCoordIndices.Assign(TexCoordIndices);
               end;
          end;
     end;
end;

Works all right, I load a mesh file on a freeForm and then convert this
to sectors and polies to the portal object. However, the portal doesn"t
do the culling. The problem is at TPortalMeshObjectList.BuildList; the
camera position (if
Items[i].PointInObject(PAffineVector(@mrci.cameraPosition)^)) never
seems to be inside any sector. I"m thinking this is a coordinate
convertion problem, but so far I haven"t been able to correct is.

У кого какие идеи?


 
Da Stranger ©   (2005-11-14 14:07) [1]

есть демка GLScene\Demos\Meshes\Portal\
+ на http://caperaven.co.za/ раньше лежала очень старая демка portal, но я с ней не разбирался.


 
Conferno   (2005-11-14 23:41) [2]


> есть демка GLScene\Demos\Meshes\Portal\

Ну,  это я есессно знаю.......


> + на http://caperaven.co.za/ раньше лежала очень старая
> демка portal, но я с ней не разбирался.

Я что-то искал-искал на сайте, но так и не нашел.... :(
Не подскажешь где именно?
Или, если ты ее скачивал, не кинешь на мыло?
Порталы - вещь интересная и нужная...


 
Da Stranger ©   (2005-11-15 21:56) [3]

Пример отправил


 
Conferno   (2005-11-15 22:19) [4]

Большое спасибо! Посмотрю...  :)


 
Conferno   (2005-11-17 18:18) [5]

Прикольно работает....
Только не пойму как использовать и увеличивать Quad"ы...



Страницы: 1 вся ветка

Текущий архив: 2006.07.16;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.028 c
2-1151342929
NektoAndrey
2006-06-26 21:28
2006.07.16
Интересная программа


15-1150266173
Layner
2006-06-14 10:22
2006.07.16
Бесплатные статистические компоненты, есть ли такие?


3-1147842962
syte_ser78
2006-05-17 09:16
2006.07.16
Помогите с востановлением базы


11-1126162768
puky
2005-09-08 10:59
2006.07.16
просмотр и конвертирование картинок


2-1151565937
Тоха
2006-06-29 11:25
2006.07.16
Как определить путь к " Program Files " в XP?