Показать все 12 сообщений этой темы на одной странице |
HLFX.Ru Forum (https://hlfx.ru/forum/index.php)
- Half-Life SDK (https://hlfx.ru/forum/forumdisplay.php?forumid=8)
-- Зеркальное отражение (https://hlfx.ru/forum/showthread.php?threadid=1602)
Зеркальное отражение
Вот собственно вопрос, как сделать Зеркальное отражение оружия в руках у игрока ? Например в КС все изначально для левой руки, а в игру оно в правой
__________________
Kiss my ass if you don't like my Ford!
------------------------------------------
Game Area51 Update 1
First Person Shooter Released Jul 24, 2017
The game is a 3d shooter with the elements of the quest.
http://button.moddb.com/download/medium/125531.png
Я не пробовал, но наверное можно отразить m_protationmatrix по горизонтали в коде StudioModelRenderer.
__________________
XaeroX
По подробней бы
__________________
Kiss my ass if you don't like my Ford!
------------------------------------------
Game Area51 Update 1
First Person Shooter Released Jul 24, 2017
The game is a 3d shooter with the elements of the quest.
http://button.moddb.com/download/medium/125531.png
Поподробнее про что? Про отражение матриц? Нужно просто умножить ее на матрицу отражения, ее вид я точно не помню, но в инете найдешь без проблем.
__________________
А не проще ли модельку отразить?
http://gamenet.com.ua/_ld/0/8_510_GFlip_v1.2.zip
__________________
Tiger! Tiger! burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?
Flash
Хз, с кодом у меня не получилось, а вообще я хотел бы заюзать модели из кс )
__________________
Kiss my ass if you don't like my Ford!
------------------------------------------
Game Area51 Update 1
First Person Shooter Released Jul 24, 2017
The game is a 3d shooter with the elements of the quest.
http://button.moddb.com/download/medium/125531.png
Flash, имхо, гораздо проще )
__________________
"Злобным гениям не нужна харизма." © Shooter__Andy
"Making stuff for an "old ugly game" can be ten times more fun than grinding on a map for a dull, next-gen title." © Lunaran
до рисования
code:
if (( m_pCurrentEntity->renderfx & RF_VIEWMODEL ) && ( r_lefthand->value == 1.0F )) { pglMatrixMode( GL_PROJECTION ); pglPushMatrix(); pglLoadIdentity(); pglScalef( -1, 1, 1 ); pglPerspective( r_newrefdef.fov_y, ( float ) r_newrefdef.rect.width / r_newrefdef.rect.height, 4, 131072 ); pglMatrixMode( GL_MODELVIEW ); pglCullFace( GL_BACK ); }
code:
if (( m_pCurrentEntity->renderfx & RF_VIEWMODEL ) && ( r_lefthand->value == 1.0F )) { pglMatrixMode( GL_PROJECTION ); pglPopMatrix(); pglMatrixMode( GL_MODELVIEW ); pglCullFace( GL_FRONT ); }
__________________
My Projects: download page
F.A.Q по XashNT
Блог разработчика в телеграме
C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'
Итак, поскольку Дядь Мишин вариант меня не устраивал, я покопался в StudioModelRenderer.cpp, посмотрел реализацию зеркала и kRenderFxReflection в спирите и написал код из нескольких строчек.
1. Создаём на клиенте квар cl_righthand, по умолчанию равный единице.
2. Находим функцию StudioDrawModel в StudioModelRenderer.cpp.
3. Втыкаем туда после строчки StudioSetUpTransform( 0 ); вот этот код:
1 | if(m_pCurrentEntity == gEngfuncs.GetViewModel() && !(cl_righthand->value)) |
2 | { |
3 | (*m_protationmatrix)[0][1] *= -1; |
4 | (*m_protationmatrix)[1][1] *= -1; |
5 | (*m_protationmatrix)[2][1] *= -1; |
6 |
7 | gEngfuncs.pTriAPI->CullFace( TRI_NONE ); |
8 | } |
Ku2zoff да ты бы мой код и не скомпилил
Нет такой функции glPerpsective ))))
PS. у тебя в коде ошибка - замени TRI_NONE на TRI_FRONT
__________________
My Projects: download page
F.A.Q по XashNT
Блог разработчика в телеграме
C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'
__________________
XaeroX блин, почему же я был уверен, что TRI_BACK есть. Забыл совсем.
__________________
My Projects: download page
F.A.Q по XashNT
Блог разработчика в телеграме
C:\DOCUME~1\C4C5~1\LOCALS~1\Temp\a33328if(72) : see declaration of 'size_t'
Временная зона GMT. Текущее время 11:38. | Показать все 12 сообщений этой темы на одной странице |
На основе vBulletin версии 2.3.0
Авторское право © Jelsoft Enterprises Limited 2000 - 2002.
Дизайн и программирование: Crystice Softworks © 2005 - 2024