Форум программистов, компьютерный форум, киберфорум
Pure Basic
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.50/26: Рейтинг темы: голосов - 26, средняя оценка - 4.50
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752

Вращение объекта вокруг точки

09.09.2012, 18:27. Показов 5511. Ответов 12
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте. Потребовались формулы вращения объекта сразу по 3ем осям. Именно формулы, не кватернионы, не матрицы. Были у меня когда-то, но потерял. Весь день ищу в инете, нету.
Прошу помощи.

Добавлено через 20 часов 26 минут
Столько сил и времени потратил, а оказывается в пб есть возможность поворачивать объекты относительно их текущего направления. Думал что это делает функция Turn, которой нет в пб.

PureBasic
1
2
3
4
5
6
7
8
9
10
11
12
13
    AngleX = -GetSpeedMouseX()
    AngleY = -GetSpeedMouseY()
    
    If AngleX
      RotateCamera(Camera, 0, AngleX, 0, #PB_Relative)
    EndIf
    
    If AngleY
      RotateCamera(Camera, AngleY, 0, 0, #PB_Relative)
    EndIf
 
CameraLocate(Camera, EntityX(Begun), EntityY(Begun), EntityZ(Begun))
MoveCamera(Camera, 0, 0, -Camera_Dist)
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
09.09.2012, 18:27
Ответы с готовыми решениями:

Изобразить вращение против часовой стрелки отрезка длиной R вокруг точки с координатами (x,y)
Не работает программа. В чем может быть ошибка? SCREEN 12 DECLARE SUB per() dim as integer x1,y1,R dim as double xr,yr print...

Вращение объекта вокруг произвольной точки
Добрый день. У всех создаваемых(по крайней мере мной) объектов "центр" находится в левом верхнем углу, что крайне неудобно если нужно...

Реализовать линейное перемещение и вращение вокруг какой-либо точки графического объекта
Здравствуйте, пожалуйста помогите с задачкой. Вот её содержание: Реализовать линейное перемещение и вращение вокруг какой-либо точки...

12
Кормпилятор
 Аватар для Quiet Snow
5044 / 1718 / 409
Регистрация: 25.04.2010
Сообщений: 4,827
Записей в блоге: 2
09.09.2012, 22:01
а оказывается в пб есть возможность поворачивать объекты относительно их текущего направления.
Относительно конкретной точки я бы ещё понял, а как это относительно НАПРАВЛЕНИЯ?
В любом случае должна быть привязка относительно установленного "центра" объекта.

Вокруг двух осей формулы в моёй старой демке смотрим, вокруг трёх, по матрицам считаем.
Там зависимости есть, обсчёт через матрицы их учитывает, плюс одновременное
масштабирование и перенос объекта.
Декартовы пространства могут не совпадать с общепринятыми, у меня ось Z направлена вверх,
как в старых учебниках геометрии, короче разберётесь.

P.S: К слову скажу, есть у меня другой 3D движок и там есть эти формулы с оптимальным
предрассчётом, но автор не давал мне права публиковать его, могу лишь сказать, что формулы
строились по рассчётам из матриц поворота, этот процесс можно весьма неплохо оптимизировать.
1
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752
09.09.2012, 22:41  [ТС]
Цитата Сообщение от >Quiet Snow< Посмотреть сообщение
Относительно конкретной точки я бы ещё понял, а как это относительно НАПРАВЛЕНИЯ
Направление взгляда я имел ввиду)
0
Кормпилятор
 Аватар для Quiet Snow
5044 / 1718 / 409
Регистрация: 25.04.2010
Сообщений: 4,827
Записей в блоге: 2
10.09.2012, 01:40
в пб есть возможность поворачивать объекты относительно их текущего направления.
Вся проблема в том, что кодом выше вы двигаете и поворачиваете КАМЕРУ, а не объект.

Чтобы повернуть объект, нужна процедура, в параметры которой войдёт идентификатор объекта,
точка вокруг которой вращать и углы. Найдёте такую в PB - хорошо. Но я что-то сомневаюсь в
наличии оной.

Бегло взглянув на функции пюра, вижу такую вещь как Entity в которые собираются меши(Mesh).
Так вот эти entity вроде бы и можно вращать, посмотрите, вполне вероятно это и решит вопрос.
В демке Texture.pb в директории PureBasic\Examples\Sources крутятся 2 робота, вроде бы в цикле
фигурируют как раз Entity
PureBasic
1
2
      RotateEntity(0, 0, 1, 0, #PB_Relative)
      RotateEntity(1, 0, 0.5, 0, #PB_Relative)
1
Кормпилятор
 Аватар для Quiet Snow
5044 / 1718 / 409
Регистрация: 25.04.2010
Сообщений: 4,827
Записей в блоге: 2
10.09.2012, 07:04
Перелопатил я немного форумов и слепил вам демку[ Cube.zip ], понасобирал инфы из чужих исходников,
может пригодится. Пять кубиков вращаются, но это не главное, главное смотрим как создать объект
полностью в программе. В дата секции прописываем координаты вершин, нормали к ним, UV к ним и
дальше прописываем номера этих вертексов, для треугольников. С освещением я долго мудохался, но
так и не понял как спекуляр настроить по-человечески, да и вообще как-то оно через задницу работает.

Как мне показалось на первый взгляд 3D движок не дотягивает до блитца, хотя работает всё
это дело весьма неплохо и игрушку среднего уровня, при хорошем дизайне моделей можно наваять.
Т.е. освещение тупо кастает на вертексы объекта направленный источник с беск. дальностью,
освещённость при этом распределяется по объектам отдельно и одинаково. Опций по более детальной
настройке освещения не нашёл.

Косяки может тут и есть, но их немного и если брать модели с 3D редакторов, то должно быть идеально.

Программа
PureBasic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
 UsePNGImageDecoder()
 Global ProgName.s = "3D Тест программа"
 
 Procedure ErrCheck (ExcResult.i, OutMessage.s, FatalErr.w)
    If ExcResult = 0
      MessageRequester ("Произошла ошибка", OutMessage, #PB_MessageRequester_Ok)
      If FatalErr: End: EndIf
    EndIf
 EndProcedure
 
 Procedure Img2Spr (ImgHandle, SprHandle, NeedCreateSpr)
 
 If NeedCreateSpr
  NewSprHandle_x_9q = CreateSprite (SprHandle, ImageWidth(ImgHandle), ImageHeight(ImgHandle), #PB_Sprite_Memory | #PB_Sprite_Texture | #PB_Sprite_AlphaBlending)
 Else
  NewSprHandle_x_9q = SprHandle
 EndIf
     ;  Определяем смещения в памяти
 StartDrawing(SpriteOutput(NewSprHandle_x_9q))
  *OutBuf_x_9q = DrawingBuffer()
 StopDrawing()
 
   StartDrawing(ImageOutput(ImgHandle))
     *TestFormat_x_9q = DrawingBuffer()
     Dbpf_x_9q.i = DrawingBufferPixelFormat()
   StopDrawing()
   If Dbpf_x_9q <> 32832
      NeedDop_x_9q = 1
      CreateImage(NewImgPromegut, ImageWidth(ImgHandle), ImageHeight(ImgHandle), 32)
      StartDrawing(ImageOutput(NewImgPromegut))
   Else: StartDrawing(ImageOutput(ImgHandle))
   EndIf
 
  *InpBuf_x_9q = DrawingBuffer()
   If NeedDop_x_9q
      DrawImage (ImageID(ImgHandle), 0, 0)
   EndIf
 StopDrawing()
 
     ;  Выясняем объём данных для 32 битного цвета
  Shirina_x_9q = ImageWidth(ImgHandle)
  Visota_x_9q = ImageHeight(ImgHandle)
  DataBegin_x_9q = (Shirina_x_9q * ImageHeight(ImgHandle) - Shirina_x_9q) << 2
  *InpBuf_x_9q = *InpBuf_x_9q + DataBegin_x_9q
 
     EnableASM
       PUSH ebx
       PUSH edi
       PUSH esi
       ADD esp, 12
         MOV ecx, Shirina_x_9q
         MOV ebx, Visota_x_9q
         MOV esi, *InpBuf_x_9q
         MOV edi, *OutBuf_x_9q
       SUB esp, 12
       Cykl_x_9q:
           PUSH ecx
             REP MOVSD
           POP ecx
           PUSH ecx
             SHL ecx, 3
             SUB esi, ecx
           POP ecx
         DEC ebx
         JNZ l_cykl_x_9q
       POP esi
       POP edi
       POP ebx
     DisableASM
 If NeedDop_x_9q: FreeImage(NewImgPromegut): EndIf
 If NeedCreateSpr: ProcedureReturn NewSprHandle_x_9q: EndIf
 
 EndProcedure
 
 Global a, b, c, d, e, f, g, h
 
   a = InitMouse()
   b = InitKeyboard()
   c = InitSprite()
   ;d = InitSprite3D()
   e = InitEngine3D()
 
   f = OpenWindow(#PB_Any, 0, 0, 1024, 768, ProgName, #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   g = OpenWindowedScreen(WindowID(f), 0, 0, 1024, 768, 0, 0, 0, #PB_Screen_NoSynchronization)
 
   ;   Создаём курсор
   CurC = CreateImage(#PB_Any, 32, 32, 32)
   StartDrawing(ImageOutput(CurC))
      DrawingMode(#PB_2DDrawing_AlphaChannel)
      Box (0, 0, 32, 32, 0)
      DrawingMode(#PB_2DDrawing_AlphaBlend)
      Line(1, 1, 32, 17, $FFFFFFFF)
      Line(0, 0, 17, 32, $FFFFFFFF)
   StopDrawing()
   Cur = Img2Spr(CurC, #PB_Any, 1)
 
 
   ;   Директория программы для работы 3D движка с файлами
   Add3DArchive(".", #PB_3DArchive_FileSystem)
 
   ;   Меш
   MyMesh = CreateMesh(#PB_Any, 100)
 
     SetMeshData(MyMesh, #PB_Mesh_Vertex | #PB_Mesh_UVCoordinate | #PB_Mesh_Normal, ?CubeData2, 26)  ;| #PB_Mesh_Normal | #PB_Mesh_Color
     SetMeshData(MyMesh, #PB_Mesh_Face, ?CubeDataIndex, 12)
 
   ;   Текстура на меш
     MyTexture = LoadTexture(1, "Textur.PNG")
     If MyTexture = 0: End: EndIf
 
   ;   Материал на ентити
 
     MyMaterial = CreateMaterial(#PB_Any, MyTexture)
     MaterialFilteringMode(MyMaterial, #PB_Material_None)            ;  Пиксели
     ;MaterialFilteringMode(MyMaterial, #PB_Material_Trilinear)      ;  Межпиксельная интерполяция
 
     ;MaterialBlendingMode(MyMaterial, #PB_Material_AlphaBlend)
 
 
   ;   Ентити из меша
 
   MyEntity = CreateEntity(#PB_Any, MeshID(MyMesh), MaterialID(MyMaterial))    ;  Собираем меш в ентити
 
   MyEntity2 = CopyEntity (MyEntity, #PB_Any)    ;  Плодим кубики
   MyEntity3 = CopyEntity (MyEntity, #PB_Any)
   MyEntity4 = CopyEntity (MyEntity, #PB_Any)
   MyEntity5 = CopyEntity (MyEntity, #PB_Any)
 
 
   ;   Позиционируем
   
   MoveEntity(MyEntity, 0, 0, 400)
   MoveEntity(MyEntity2, 150, 150, 400)
   MoveEntity(MyEntity3, -150, 150, 400)
   MoveEntity(MyEntity4, -150, -150, 400)
   MoveEntity(MyEntity5,  150, -150, 400)
 
   ;   Уменьшаем кубики
 
   ScaleEntity (MyEntity2, 0.5, 0.5, 0.5)
   ScaleEntity (MyEntity3, 0.5, 0.5, 0.5)
   ScaleEntity (MyEntity4, 0.5, 0.5, 0.5)
   ScaleEntity (MyEntity5, 0.5, 0.5, 0.5)
 
   ;   Камера
    
   CreateCamera(0, 0, 0, 100, 100)
   CameraLocate(0, 0, 0, 1000)
 
 
   ;   Освещение
   AmbientColor(RGB(90, 90, 90))
   AntialiasingMode(#PB_AntialiasingMode_x6)
 
   CreateLight(0, RGB(255, 255, 255),  0, 0, 1300)
   LightSpecularColor(0, RGB(1,1,1))
 
   MaterialShadingMode(MyMaterial, #PB_Material_Phong)
   ;DisableMaterialLighting(MyMaterial, 1)                    ;  Отключить освещение на материале
 
   ;MaterialAmbientColor(MyMaterial, RGB(255, 255, 255))
   ;MaterialSpecularColor(MyMaterial, RGB(255, 255, 255))
   ;MaterialDiffuseColor(MyMaterial, RGB(255, 255, 255))
   ;ScrollMaterial(MyMaterial, 0.55, 0, 1)               ;  Прокрутка текстуры
 
  Repeat
    ExamineKeyboard()
    ExamineMouse()
    Event = WindowEvent()
    
      mx = MouseX()
      my = MouseY()
    
    ClearScreen(0)
    RenderWorld()
 
         DisplayTransparentSprite(Cur, mx, my - 1)              ;   Курсор
         
         RotateEntity(MyEntity, 0.5, 0, 1, #PB_Relative)
         
         RotateEntity(MyEntity2, 1, 0, 0, #PB_Relative)
         RotateEntity(MyEntity3, 0, 1, 0, #PB_Relative)
         RotateEntity(MyEntity4, 0, 0, 1, #PB_Relative)
         RotateEntity(MyEntity5, 0.1, 0, 0, #PB_Relative)
 
 
    FlipBuffers()
    Delay(12)
  Until KeyboardPushed(#PB_Key_Escape)
 
#SQRT13 = 0.57735026
 
DataSection
 
  CubeData2:
  
    Data.f -100.0,-100.0, 100.0
    Data.f -#SQRT13,-#SQRT13,#SQRT13
    Data.f 0.0, 1.0
    Data.f -100.0,-100.0, 100.0
    Data.f -#SQRT13,-#SQRT13,#SQRT13
    Data.f 1.0, 1.0
    Data.f -100.0,-100.0, 100.0
    Data.f -#SQRT13,-#SQRT13,#SQRT13
    Data.f 1.0, 1.0
    Data.f -100.0, 100.0, 100.0
    Data.f -#SQRT13,#SQRT13,#SQRT13
    Data.f 0.0, 0.0
    Data.f -100.0, 100.0, 100.0
    Data.f -#SQRT13,#SQRT13,#SQRT13
    Data.f 0.0, 1.0
    Data.f -100.0, 100.0, 100.0
    Data.f -#SQRT13,#SQRT13,#SQRT13
    Data.f 1.0, 0.0
    Data.f -100.0,-100.0,-100.0
    Data.f -#SQRT13,-#SQRT13,-#SQRT13
    Data.f 0.0, 1.0
    Data.f -100.0,-100.0,-100.0
    Data.f -#SQRT13,-#SQRT13,-#SQRT13
    Data.f 1.0, 0.0
    Data.f -100.0,-100.0,-100.0
    Data.f -#SQRT13,-#SQRT13,-#SQRT13
    Data.f 1.0, 1.0
    Data.f -100.0, 100.0,-100.0
    Data.f -#SQRT13,#SQRT13,-#SQRT13
    Data.f 0.0, 0.0
    Data.f -100.0, 100.0,-100.0
    Data.f -#SQRT13,#SQRT13,-#SQRT13
    Data.f 0.0, 0.0
    Data.f -100.0, 100.0,-100.0
    Data.f -#SQRT13,#SQRT13,-#SQRT13
    Data.f 1.0, 0.0
    Data.f 100.0, -100.0, 100.0
    Data.f #SQRT13,-#SQRT13,#SQRT13
    Data.f 0.0, 1.0
    Data.f 100.0, -100.0, 100.0
    Data.f #SQRT13,-#SQRT13,#SQRT13
    Data.f 0.0, 1.0
    Data.f 100.0, -100.0, 100.0
    Data.f #SQRT13,-#SQRT13,#SQRT13
    Data.f 0.0, 1.0
    Data.f 100.0, -100.0, 100.0
    Data.f #SQRT13,-#SQRT13,#SQRT13
    Data.f 1.0, 1.0
    Data.f 100.0,  100.0, 100.0
    Data.f #SQRT13,#SQRT13,#SQRT13
    Data.f 0.0, 0.0
    Data.f 100.0,  100.0, 100.0
    Data.f #SQRT13,#SQRT13,#SQRT13
    Data.f 1.0, 0.0
    Data.f 100.0,  100.0, 100.0
    Data.f #SQRT13,#SQRT13,#SQRT13
    Data.f 1.0, 1.0
    Data.f 100.0, -100.0,-100.0
    Data.f #SQRT13,-#SQRT13,-#SQRT13
    Data.f 0.0, 0.0
    Data.f 100.0, -100.0,-100.0
    Data.f #SQRT13,-#SQRT13,-#SQRT13
    Data.f 0.0, 1.0
    Data.f 100.0, -100.0,-100.0
    Data.f #SQRT13,-#SQRT13,-#SQRT13
    Data.f 1.0, 1.0
    Data.f 100.0,  100.0,-100.0
    Data.f #SQRT13,#SQRT13,-#SQRT13
    Data.f 0.0, 0.0
    Data.f 100.0,  100.0,-100.0
    Data.f #SQRT13,#SQRT13,-#SQRT13
    Data.f 1.0, 0.0
    Data.f 100.0,  100.0,-100.0
    Data.f #SQRT13,#SQRT13,-#SQRT13
    Data.f 1.0, 0.0
    Data.f 100.0,  100.0,-100.0
    Data.f #SQRT13,#SQRT13,-#SQRT13
    Data.f 1.0, 0.0
 
  CubeDataIndex:
    Data.w 1,7,19
    Data.w 19,13,1
    Data.w 4,18,24
    Data.w 24,10,4
    Data.w 0,15,17
    Data.w 17,3,0
    Data.w 14,21,25
    Data.w 23,16,12
    Data.w 20,8,11
    Data.w 11,22,20
    Data.w 6,2,5
    Data.w 5,9,6
 
EndDataSection
Миниатюры
Вращение объекта вокруг точки   Вращение объекта вокруг точки  
2
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752
10.09.2012, 11:47  [ТС]
Спасибо, конечно.) Но я это уже знаю, т.к. делаю редактор аналогичный WarCraft'у, и редактирование ландшафта уже сделано. И код, который я скинул, делает именно то, что мне нужно.
Заменил объект ведущей камерой.
Камера прикреплена у меня к другой камере(ведущей), которая двигается и поворачивается вместе с основной. Почему камера? Да потому что в пб только камера может двигаться по своим осям, а не глобальным.

Добавлено через 1 минуту
То, что движок тут хуже блитца это да. Но для редактора сойдет)
0
10.09.2012, 12:34

Не по теме:

Цитата Сообщение от Le Thaw Посмотреть сообщение
движок тут хуже блитца это да
В версии PureBasic 5.0, добавили много новых функций 3D. Может будет уже не хуже.
Engine3D
Engine3D:
---------
Added: a new optional parameter to InitEngine3D() with constants #PB_Engine3D_DebugLog and #PB_Engine3D_DebugOutput
Added: RayPick(x, y, z, x2, y2, z2 [, PickMask]) ; Returns the first #Entity crossed by the ray
Added: 'PickMask' parameter to MousePick()

World:
------
Added: RenderWorld() now returns 'TimeSinceLastFrame', in milliseconds
Added: SkyBox() and SkyDome() now supports Fog()
Added: 'Color' and 'TextureSize' parameters to WorldShadows()
Added: #PB_World_UnderWater and #PB_World_WaterGodRays flags to CreateWater()

Camera:
------
Added: CameraViewWidth(#Camera) ; return camera width in pixels
Added: CameraViewHeight(#Camera) ; return camera height in pixels
Added: CameraViewX(#Camera) ; return Y position in pixels
Added: CameraViewY(#Camera) ; return X position in pixels
Added: CameraDirection(#Camera, x, y, z) ; change the direction
Added: CameraDirectionX/Y/Z(#Camera) - Retrieve the direction of the #Camera.
Added: new 'IsActive' optional parameter to render to texture for CreateCamera()
Added: SetCameraFixedYawAxis(#Camera, Mode [VectorX, VectorY, VectorZ]) - Change the way the yaw axis is managed
Changed: CameraLookAt() ; doesn't change the direction anymore



Material:
---------
Added: ScaleMaterial(#Material, x, y)
Added: MaterialFog(#Material, Color, Intensity, StartDistance, EndDistance) - Display a fog effect on the material
Added: ReloadMaterial(MaterialName$, Filename$, ParseScript)
Added: ResetMaterial(ObjectType)
Added: #PB_Material_Anisotropic support to MaterialFilteringMode() and #PB_Default support as Material to set the default settings for materials.
Added: #PB_Material_Wireframe, #PB_Material_Point and #PB_Material_Solid to MaterialShadingMode()


Node:
-----
Added: NodeFixedYawAxis()

Sound3D:
--------
Added: SoundListenerLocate() ; to move the sound listener (the ear) in the world

Entity:
-------
Added: new 'PickMask' optional paramater for CreateEntity()
Added: #PB_Entity_Wireframe, #PB_Entity_Solid, #PB_Entity_Point and #PB_Entity_DisplaySkeleton to EntityRenderMode()
Added: FreeEntityJoints(#Entity) - Free all joints associated with the #Entity.
Added: AttachEntityObject(#Entity, Bone$, ObjectID [, x, y, z, Pitch, Roll, Yaw]) - Attach an object to the #Entity.
Added: DetachEntityObject(#Entity, ObjectID) - Detach the object from the #Entity.
Added: EntityBoneX/Y/Z(entityID, Bone$ [, OffsetX, OffsetY, OffsetZ])
Added: EntityBonePitch()
Added: EntityBoneRoll()
Added: EntityBoneYaw()
Added: DirectionX/Y/Z optional parameters to EntityLookAt()
Added: EntityVelocity(#Entity, x, y, z) - Change the linear velocity of the #Entity.
Added: EntityAngularFactor(#Entity, x, y, z) - Change the angular factor of the #Entity.
Added: EntityLinearFactor(#Entity, x, y, z) - Change the linear factor of the #Entity.
Added: EntityCustomParameter(#Entity, SubEntityIndex, ParameterIndex, Value1, Value2, Value3, Value4) - Set a custom parameter to the #Entity shader script.
Added: EntityParentNode(#Entity)
Added: EntityBoundingBoxX/Y/Z(#Entity, Point, Flags)
Added: DisableEntityBody(#Entity, Disable)
Added: to Get/SetEntityAttributes:
#PB_Entity_VelocityX: Get
#PB_Entity_VelocityY: Get
#PB_Entity_VelocityZ: Get
#PB_Entity_MassCenterX: Get/Set
#PB_Entity_MassCenterY: Get/Set
#PB_Entity_MassCenterZ: Get/Set
#PB_Entity_MaxVelocity: Get/Set



EntityAnimation:
----------------
Added: AddEntityAnimationTime(#Entity, Animation$, Time) - Add time to the specified #Entity animation.
Added: EnableEntityAnimation(#Entity, Animation$, Enable [, Loop]) - Enable the specified #Entity animation.
Added: EntityAnimationStatus(#Entity, Animation$) - Return the specified #Entity animation status (constants: #PB_EntityAnimation_Stopped, #PB_EntityAnimation_Started, #PB_EntityAnimation_Unknown)
Added: EntityAnimationBlendMode(#Entity, Mode) - with #PB_Entity_Average and #PB_Entity_Cumulative
Added: GetEntityAnimationTime(#Entity, Animation$) - Get the current #Entity animation time.
Added: SetEntityAnimationTime(#Entity, Animation$, Time) - Set the current #Entity animation time.
Added: GetEntityAnimationWeight(#Entity, Animation$) - Get the #Entity animation weight.
Added: SetEntityAnimationWeight(#Entity, Animation$, Weight) - Set the #Entity animation weight (useful for EntityAnimationBlendMode()).
Added: GetEntityAnimationLength(#Entity, Animation$) - Get the #Entity animation length.
Added: SetEntityAnimationLength(#Entity, Animation$, Length) - Set the #Entity animation length.
Added: UpdateEntityAnimation(#Entity, Animation$) - Update the animation, especially after vertex changes

Node:
-----
Change: Attach/DetachNodeObject() removed the 'type' object
Added: NodeLookAt(): Optional DirectionX/Y/Z parameter



NodeAnimation
-------------
Added: FreeNodeAnimation(#NodeAnimation) - Free the specified #NodeAnimation.
Added: CreateNodeAnimation(#NodeAnimation, Length, Interpolation, RotationInterpolation) - Create a new #NodeAnimation.
'Interpolation' can be: #PB_NodeAnimation_Linear or #PB_NodeAnimation_Spline
'RotationInterpolation' can be #PB_NodeAnimation_LinearRotation or #PB_NodeAnimation_SphericalRotation
Added: CreateNodeAnimationTrack(#NodeAnimation, Index, NodeID) - Create a new track for the #NodeAnimation.
Added: CreateNodeAnimationKeyFrame(#NodeAnimati on, Track, Time, x, y, z) - Create a new keyframe for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameTime(#NodeAnimat ion, Track, KeyFrame) - Get the keyframe time for the #NodeAnimation track.
Added: SetNodeAnimationKeyFramePosition(#NodeAn imation, Track, KeyFrame, x, y, z) - Set the keyframe position for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameX(#NodeAnimation , Track, KeyFrame) - Get the x keyframe position for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameY(#NodeAnimation , Track, KeyFrame) - Get the y keyframe position for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameZ(#NodeAnimation , Track, KeyFrame) - Get the z keyframe position for the #NodeAnimation track.
Added: SetNodeAnimationKeyFrameRotation(#NodeAn imation, Track, KeyFrame, Pitch, Yaw, Roll) - Set the keyframe position for the #NodeAnimation track.
Added: GetNodeAnimationKeyFramePitch(#NodeAnima tion, Track, KeyFrame) - Get the keyframe pitch for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameYaw(#NodeAnimati on, Track, KeyFrame) - Get the y keyframe yaw for the #NodeAnimation track.
Added: GetNodeAnimationKeyFrameRoll(#NodeAnimat ion, Track, KeyFrame) - Get the z keyframe roll for the #NodeAnimation track.
Added: SetNodeAnimationKeyFrameScale(#NodeAnima tion, Track, KeyFrame, ScaleX, ScaleY, ScaleZ) - Set the keyframe scale for the #NodeAnimation track.
Added: AddNodeAnimationTime(#NodeAnimation, Time) - Add time to the specified #NodeAnimation.
Added: EnableNodeAnimation(#NodeAnimation, Enable [, Loop]) - Enable the specified #NodeAnimation.
Added: NodeAnimationStatus(#NodeAnimation) - Return the specified #NodeAnimation status.
Added: GetNodeAnimationTime(#NodeAnimation) - Get the current #NodeAnimation time.
Added: SetNodeAnimationTime(#NodeAnimation, Time) - Set the current #NodeAnimation time.
Added: GetNodeAnimationWeight(#NodeAnimation) - Get the #NodeAnimation weight.
Added: SetNodeAnimationWeight(#NodeAnimation, Weight) - Set the #NodeAnimation weight.
Added: GetNodeAnimationLength(#NodeAnimation) - Get the #NodeAnimation length.
Added: SetNodeAnimationLength(#NodeAnimation, Length) - Set the #NodeAnimation length.

Light:
------
Added: LightAttenuation(#Light, Range, Constant, Linear, Quadratic)
Added: LightX(#Light)
Added: LightY(#Light)
Added: LightZ(#Light)
Added: LightDirection(#Light, x, y, z)
Added: LightDirectionX(#Light)
Added: LightDirectionY(#Light)
Added: LightDirectionZ(#Light)
Added: RotateLight(#Light, Pitch, Yaw, Roll [, Flags])
Added: LightPitch(#Light)
Added: LightYaw(#Light)
Added: LightRoll(#Light)


Particule:
----------
Added: GetScriptParticle(#ParticleEmitter, Name$) - Get a particule emitter defined in scripts files.

Texture:
--------
Added: CreateRenderTexture(#Texture, CameraID, Width, Height, RenderedTextureName$ [, Flags]) - Create a new rendered based #Texture.
Flags can be: #PB_Texture_ManualUpdate or PB_Texture_AutomaticUpdate (default)
Added: UpdateRenderTexture(#Texture) ; update the rendered texture, only in manual mode
Added: SaveRenderTexture(#Texture, Filename$)
Added: CreateCubeMapTexture(#Texture, CameraID, Width, Height, RenderedTextureName$ [, Flags]) - Create a new rendered based #Texture.
Added: EntityCubeMapTexture(#Texture, #Entity) - Apply the cube map #Texture to the #Entity.
Updated: CreateTexture() now handle alpha textures as well


Effect:
-------
Updated: HideEffect(integer effectID, int hidden) ; now handle ribbon as well
Added: EffectID(#Effect)
Changed: CreateRibbonEffect() - 'InitialWidth' parameter has been removed
Added: RibbonEffectWidth(#Effect, ChainIndex, Width, FadeoutWidth)
Added: AttachRibbonEffect(#Effect, NodeID) - Attach the ribbon #Effect to the node.
Added: DetachRibbonEffect(#Effect, NodeID) - Detach the node from the ribbon #Effect.
Added: CreateLensFlareEffect(#Effect, CameraID, NodeID, BurstSize, HaloSize, HaloMaterialID, CircleMaterialID, BurstMaterialID) - Create a new lens flare #Effect.
Added: LensFlareEffectColor(#Effect, ColorType, Color) - Change the color of the specified lens flare part.

Joint:
------
Added: EnableHingeJointAngularMotor(#Joint, Enable, TargetVelocity, MaxMotorImpulse) - Enable the angular motor on the hinge #Joint.
Modified: Modification de la lib Joint pour supprimer la limitation d'un joint par entity:
- Ajout d'un paramètre #Joint pour les fonctions suivantes : ConeTwistJoint(), HingeJoint(), PointJoint(), SliderJoint()
- Remplacement du paramètre #Entity par le paramètre #Joint dans les fonctions suivantes : FreeJoint()
Added: #PB_HingeJoint_LowerLimit and #PB_HingeJoint_UpperLimit to Get/SetJointAttribute()


VertexAnimation:
-----------------
Added: CreateVertexAnimation(#Mesh, Animation$, Length) - Create a new vertex animation for the #mesh.
Added: CreateVertexTrack(#Mesh, Animation$, Index) - Create a new track to the #Mesh animation.
Added: CreateVertexPoseKeyFrame(#Mesh, Animation$, Track, Time) - Create a new keyframe to the #Mesh track.
Added: AddVertexPoseReference(#Mesh, Animation$, Track, Index, PoseIndex, Influence) - Add a new vertex pose reference to the #Mesh track.
Added: UpdateVertexPoseReference(#Mesh, Animation$, Track, Index, PoseIndex, Influence) - Update a new vertex pose reference to the #Mesh track.
Added: VertexPoseReferencesSize(#Mesh, Animation$, Track, Index) - Return the vertex pose reference size of the specified #Mesh track.
Added: MeshPoseName(#Mesh, PoseIndex) - Return the mesh pose name.


StaticGeometry:
---------------
Added: Optional 'Pitch', 'Yaw', 'Roll' parameters to AddStaticGeometryEntity()


Spline:
-------
CreateSpline(#Spline) - Create a new empty #Spline
FreeSpline(#Spline) - Free the #Spline.
AddSplinePoint(#Spline, x, y, z)
ClearSpline(#Spline) - Clear the #Spine.
CountSplinePoints(#Spline) - Return the number of point in the #Spine.
SplinePointX(#Spline, Index) - Return the x position of the #Spline point.
SplinePointY(#Spline, Index) - Return the y position of the #Spline point.
SplinePointZ(#Spline, Index) - Return the z position of the #Spline point.
UpdateSplinePoint(#Spline, Index, x, y, z) - Update the specified #Spline point.
ComputeSpline(#Spline, Time) - Compute the #Spline at the given time.
SplineX(#Spline) - Return the x position of the #Spline.
SplineY(#Spline) - Return the y position of the #Spline.
SplineZ(#Spline) - Return the z position of the #Spline.


Terrain:
--------
FreeTerrain(#Terrain) - Free the #Terrain.
SetupTerrains(LigthID, Distance, Flags) - Setup the default options for all terrains.
CreateTerrain(#Terrain, Size, WorldSize, Scale, Layer, Filename$, Extension$) - Create a new #Terrain.
TerrainPhysicBody(#Terrain, Restitution, Friction) - Add a static physic body to the #Terrain.
DefineTerrainTile(#Terrain, TileX, TileY, Heightname$, FlipX, FlipY) - Defines a new #Terrain tile.
AddTerrainTexture(#Terrain, Layer, WorldSize, DiffuseSpecular$, NormalHeight$) - Add a texture to the #Terrain.
BuildTerrain(#Terrain) - Construct the #Terrain.
TerrainLocate(#Terrain, x, y, z) - Change the #Terrain location.
TerrainHeight(#Terrain, x, z) - Return the height of the #Terrain at the specified coordinates.
TerrainTileHeightAtPosition(#Terrain, TileX, TileY, Layer, x, y) - Return the height of the #Terrain tile.
TerrainTilePointX(#Terrain, TileX, TileY, x, y, z) - Return the x position in the #Terrain tile of the point.
TerrainTilePointY(#Terrain, TileX, TileY, x, y, z) - Return the y position in the #Terrain tile of the point.
TerrainTileSize(#Terrain, TileX, TileY) - Return the size of the #Terrain tile.
GetTerrainTileHeightAtPoint(#Terrain, TileX, TileY, x, y) - Get the height of the #Terrain tile at the specified position.
SetTerrainTileHeightAtPoint(#Terrain, TileX, TileY, x, y, Height) - Set the height of the #Terrain tile at the specified position.
UpdateTerrain(#Terrain) - Update the whole #Terrain.
TerrainTileLayerMapSize(#Terrain, TileX, TileY) - Return the #Terrain tile layer map size.
GetTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer, x, y) - Get the #Terrain tile layer blend value.
SetTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer, x, y, Value) - Set the #Terrain tile layer blend value.
UpdateTerrainTileLayerBlend(#Terrain, TileX, TileY, Layer) - Update the #Terrain tile blend value.
TerrainMousePick(#Terrain, CameraID, x, y) - Perform a mouse picking on the #Terrain.
SaveTerrain(#Terrain, ModifiedOnly) - Save the #Terrain on disk.
TerrainRenderMode(#Terrain, Flags) - Change the #Terrain render mode.

Window3D:
---------
InputEvent3D(): Added a special key parameter to handle non printable keys


Obsolete:
---------
Removed: AnimateEntity() (replaced with Start/StopEntityAnimation())
Removed: #PB_Entity_Wireframe, #PB_Entity_Point and #PB_Entity_Solid to EntityRenderMode()
Removed: CheckEntityCollision(), NextWorldCollision(), FirstWorldCollisionEntity(), SecondWorldCollisionEntity()


Движок был обновлен до версии 1.8.0.
Updated: Ogre to 1.8.0, bullet to 2.80, hydrax to 0.5.4, CEGUI to 0.7.7

2
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752
10.09.2012, 12:57  [ТС]
ХЕРА! Вот это я понимаю. Но когда же он выйдет? Наверно года через пол. + 2 месяца на взлом.
0
10.09.2012, 13:06

Не по теме:

Цитата Сообщение от Le Thaw Посмотреть сообщение
Но когда же он выйдет?
Сейчас на стадии "бета 2".
Думаю что до конца года будет релиз.

1
Кормпилятор
 Аватар для Quiet Snow
5044 / 1718 / 409
Регистрация: 25.04.2010
Сообщений: 4,827
Записей в блоге: 2
10.09.2012, 17:07
Да вот этого там явно нехватало:
LightAttenuation(#Light, Range, Constant, Linear, Quadratic)
Хорошо, что разработчики стараются идти "в ногу со временем".

Пожалуй подожду, когда спрайты прибавят скорости,,, в 10 раз)))
А то нехорошо вышло, современные видюхи позволяют гигатексели выводить, а
какую-то вшивую 2D не тянут, причём оптимизированную по самые яйца...

Спасибо, конечно.) Но я это уже знаю, т.к. делаю редактор аналогичный WarCraft'у, и редактирование ландшафта уже сделано.
Ясно, но вы всё таки окиньте взглядом исходник, авось чего узреете.
1
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752
10.09.2012, 17:42  [ТС]
Лично меня пока устраивают спрайты. Гуи не тормозит, значит все окей.
0
05.11.2012, 22:56

Не по теме:

Цитата Сообщение от Le Thaw Посмотреть сообщение
Но когда же он выйдет?
Сегодня вечером был релиз PureBasic 5.00.

0
37 / 37 / 1
Регистрация: 07.09.2010
Сообщений: 752
15.12.2012, 02:13  [ТС]
Решение
PureBasic
1
2
3
  x_Plus.d = Sin(rad_Yaw)*|!REG3XP3!>Cos(rad_Pit)*Dist
  y_Plus.d = Cos(rad_Yaw)*Dist
  z_Plus.d = Sin(rad_Yaw)*|!REG3XP3!>Sin(rad_Pit)*Dist
1
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
15.12.2012, 02:13
Помогаю со студенческими работами здесь

Вращение точки вокруг другой точки в некоторой плоскости
Доброго времени суток. Хочу написать модель атома в 3d. Нужно определить закон смены координат точки А вокруг точки В. Но вся проблема в...

Вращение объекта вокруг другого объекта
Как сделать вращение объекта вокруг другого объекта? Например: создаём куб, затем внутри него создать ещё один куб и отодвинуть этот...

Вращение вокруг объекта
Добрый день. Как заставить один объект вращаться вокруг другого?

Вращение модели вокруг объекта
Не могу понять, как вращать один объект, вокруг другого так, что б один конец вращался по дуге, а другой все время следил за мышкой. Очень...

Вращение объекта вокруг своей оси
Есть такой класс class TPoint(): def __init__(self): self._x = random.randint(0, WIDTH - 35) self._y =...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
13
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Обработчик клика мыши в браузере ПК и касания экрана в браузере на мобильном устройстве
8Observer8 02.02.2026
Содержание блога Для начала пошагово создадим рабочий пример для подготовки к экспериментам в браузере ПК и в браузере мобильного устройства. Потом напишем обработчик клика мыши и обработчик. . .
Философия технологии
iceja 01.02.2026
На мой взгляд у человека в технических проектах остается роль генерального директора. Все остальное нейронки делают уже лучше человека. Они не могут нести предпринимательские риски, не могут. . .
SDL3 для Web (WebAssembly): Вывод текста со шрифтом TTF с помощью SDL3_ttf
8Observer8 01.02.2026
Содержание блога В этой пошаговой инструкции создадим с нуля веб-приложение, которое выводит текст в окне браузера. Запустим на Android на локальном сервере. Загрузим Release на бесплатный. . .
SDL3 для Web (WebAssembly): Сборка C/C++ проекта из консоли
8Observer8 30.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
SDL3 для Web (WebAssembly): Установка Emscripten SDK (emsdk) и CMake для сборки C и C++ приложений в Wasm
8Observer8 30.01.2026
Содержание блога Для того чтобы скачать Emscripten SDK (emsdk) необходимо сначало скачать и уставить Git: Install for Windows. Следуйте стандартной процедуре установки Git через установщик. . . .
SDL3 для Android: Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 29.01.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами. Версия v3 была полностью переписана на Си, в. . .
Инструменты COM: Сохранение данный из VARIANT в файл и загрузка из файла в VARIANT
bedvit 28.01.2026
Сохранение базовых типов COM и массивов (одномерных или двухмерных) любой вложенности (деревья) в файл, с возможностью выбора алгоритмов сжатия и шифрования. Часть библиотеки BedvitCOM Использованы. . .
SDL3 для Android: Загрузка PNG с альфа-каналом с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 28.01.2026
Содержание блога SDL3 имеет собственные средства для загрузки и отображения PNG-файлов с альфа-каналом и базовой работы с ними. В этой инструкции используется функция SDL_LoadPNG(), которая. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru