Посоветуйте русскую доку про Extrusion из VRML
От: GhostCoders Россия  
Дата: 23.07.07 17:10
Оценка:
Нужна русская документация описания работы Extrusion в VRML 2.0.
У меня уже есть документация, но на английском, и мне не ясна пара нюансов.

Заранее спасибо
Третий Рим должен пасть!
Re: Посоветуйте русскую доку про Extrusion из VRML
От: NSP Россия  
Дата: 23.07.07 17:32
Оценка:
Здравствуйте, GhostCoders.

http://citforum.mstu.edu.ru/internet/vrml97/vrml97_05.shtml#4
На интересной работе и сны интересные видишь
Re[2]: Посоветуйте русскую доку про Extrusion из VRML
От: GhostCoders Россия  
Дата: 24.07.07 06:24
Оценка:
К сожалению я это уже читал здесь:

http://www.codenet.ru/webmast/vrml97/vrml97_05.php

Мне это не подходит.
У меня задача стоит такая.
На входе у меня эта самая VRML экструзия со всеми ее параметрами.
На выходе я должен получить набор треугольников (TriangleMesh или IndexedFaceSet) из этой самой экструзии.
Я нашел такой алгоритм на английском.
Его прочитать можно здесь:

http://tecfa.unige.ch/guides/vrml/vrml97/spec/part1/nodesRef.html#Extrusion

В частности, в алгоритме описывается, как определяется ориентация SCP — плоскости в которой будет находиться поперечное сечение (crossSection)
по координатам задающей линии.
Задается определение оси У и Z для этой плоскости, X получаем через векторное произведение Y*Z.

Вот читата про это из описания алгоритма:


   Let n be the number of spines and let i be the index variable satisfying 0 <= i < n:

   1. For all points other than the first or last: The Y-axis for spine[i] is found by normalizing the vector defined by (spine[i+1] - spine[i-1]).
   2. If the spine curve is closed: The SCP for the first and last points is the same and is found using (spine[1] - spine[n-2]) to compute the Y-axis.
   3. If the spine curve is not closed: The Y-axis used for the first point is the vector from spine[0] to spine[1], and for the last it is the vector from spine[n-2] to spine[n-1]. 

The Z-axis is determined as follows:

   4. For all points other than the first or last: Take the following cross-product:

      Z = (spine[i+1] - spine[i]) × (spine[i-1] - spine[i])
        

   5. If the spine curve is closed: The SCP for the first and last points is the same and is found by taking the following cross-product:

      Z = (spine[1] - spine[0]) × (spine[n-2] - spine[0]) 

   6. If the spine curve is not closed: The Z-axis used for the first spine point is the same as the Z-axis for spine[1]. The Z-axis used for the last spine point is the same as the Z-axis for spine[n-2].
   7. After determining the Z-axis, its dot product with the Z-axis of the previous spine point is computed. If this value is negative, the Z-axis is flipped (multiplied by -1). In most cases, this prevents small changes in the spine segment angles from flipping the cross-section 180 degrees. 

Once the Y- and Z-axes have been computed, the X-axis can be calculated as their cross-product.


Вроде бы все ясно, но не ясно следующее:
1. как используется раздел orientation? Я так понял, что сначала получаем 1-ю ориентацию по координатам задающей линии (по вышеописанным формулам) о потом еще и применяем поворот вокруг оси на угол (раздел orientation)? Так? Все правильно понимаю?

2. Не понятно следующее в тексте:

If the Z-axis of the first point is undefined (because the spine is not closed and the first two spine segments are collinear) then the Z-axis for the first spine point with a defined Z-axis is used.

If the entire spine is collinear, the SCP is computed by finding the rotation of a vector along the positive Y-axis (v1) to the vector formed by the spine points (v2). The Y=0 plane is then rotated by this value.


Мой перевод:
Если Z-ось для первой точки неопределена (из-за того, что цепочка задающих точек не замкнута и первые два сегмента линий колинеарны) то, Z-Ось для первой точки определяем как .....(а дальше не ясно. вроде используем уже какую-нибудь определенную Z-ось, но какую именно?) .

Если вся цепочка спина колинеарна, ... (и дальше непонятно как определяется Z-ось для этого случая)....

Буду благодарен за любую помощь!
Третий Рим должен пасть!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.