forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   3D-программирование (http://forum.boolean.name/forumdisplay.php?f=12)
-   -   3D Sprite (http://forum.boolean.name/showthread.php?t=585)

pax 19.01.2006 15:53

Вот в справке написано:
Цитата:

CreateSprite ( [parent] )
Parameters
parent (optional) - parent entity of sprite*

Description
Creates a sprite entity and returns its handle. Sprites are simple flat (usually textured) rectangles made from two triangles. Unlike other entity objects they don't actually have a mesh that can be manipulated.

The sprite will be positioned at 0,0,0 and extend from 1,-1 to +1,+1.

Sprites have two real strengths. The first is that they consist of only two polygons; meaning you can use many of them at once. This makes them ideal for particle effects and 2D-using-3D games where you want lots of sprites on-screen at once.

Secondly, sprites can be assigned a view mode using SpriteViewMode. By default this view mode is set to 1, which means the sprite will always face the camera. So no matter what the orientation of the camera is relative to the sprite, you will never actually notice that they are flat; by giving them a spherical texture, you can make them appear to look no different than a normal sphere.

The optional parent parameter allow you to specify a parent entity for the sprite so that when the parent is moved the child sprite will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent.

Specifying a parent entity will still result in the sprite being created at position 0,0,0 rather than at the parent entity's position.

Note: Sprites have their own commands for rotation and scaling.

See also: LoadSprite, RotateSprite, ScaleSprite, HandleSprite, SpriteViewMode, PositionEntity, MoveEntity, TranslateEntity, EntityAlpha, FreeEntity.*

звучит так: наложив сферическую текстуру можно сделать спрайт неотличимым от сферы...

Может подскажите как это сделать, а то у меня ничего не получается :dontknow:

Платон 19.01.2006 17:45

Создаешь текстуру сферы (например рендер шарика в максе) и загружаешь спрайт из этой текстуры, с флагом 2 (задник текстуры должен быть черным цветом). Спрайт все время повернут лицом к камере, поэтому если смотреть сдалека, то будет похоже на сферу. Ну а в близи конечно будет заметно что это спрайт, а не 3д фигура.

sprite=LoadSprite("sphere.bmp",2)

ЗЫ
Кстати, эта техника применяется в системах LOD(Level of detail), когда на последнем уровне детализации(когда модель находится достаточно далеко от наблюдателя), вместо модели ставят спрайт с изображением этой модели.

axel186 19.01.2006 23:35

Между прочим дуум первый и второй так сделаны :)), (на спрайтах)

alcoSHoLiK 20.01.2006 00:33

LOD также достаточно широко используется. Например, в игре S.T.A.L.K.E.R. деревья сделаны в виде 3D-моделей, но когда они находятся на большом расстоянии от игрока, на их место подставляются спрайты.

jimon 20.01.2006 15:28

[WC]killer пробовал так делать лес из спрайтов
так там из-за етой подстановки лес тормозил больше чем без нее

помнится пришли к выводу что нарисовать биллбоард быстрее чем спрайт :)

pax 20.01.2006 16:40

Даааа.... а я думал что имелась ввиду сферическая карта текстуры, т.е. загруженная с флагом 64... ну да ладно... спасибо что объяснили...

Платон 21.01.2006 13:00

Цитата:

Originally posted by jimon@Jan 20 2006, 02:28 PM
помнится пришли к выводу что нарисовать биллбоард быстрее чем спрайт :)

Биллбоард это и есть спрайт :)

jimon 21.01.2006 13:35

оно то да :) но в блице неразбириха...

Putin 16.10.2008 21:44

Re: 3D Sprite
 
Подскажите Люди, как правильно загружать спрайты чтоб фонового цвета не было видна?

-=Jack=- 10.01.2009 21:17

Ответ: 3D Sprite
 
Сохраняй спрайт с альфа-каналом и загрузай с флажком 2 (Alpha - прозрачный)


Часовой пояс GMT +4, время: 13:39.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Перевод: zCarot