Как стать автором
Обновить
12
0

Пользователь

Отправить сообщение
Перед тем, как перейти к последней части, стоить пояснить работу с простыми void-указателями. Сложение, вычитание, инкремент, декремент и т.д. не запрещены для типа void, однако могут вызывать предупреждения в C++ и не вполне понятное поведение.


Когда это в C и C++ разрешили арифметику с void *? Это неопределенное поведение. Читайте ISO/IEC 9899:2011, раздел „6.5.6 Additive operators”, §2.

Оптимизации в первую очередь проводятся над intermediate representation, когда компилятор может взглянуть на control-flow и data-flow программы. Оптимизации под конкретную архитектуру происходят ближе к коду на уровне Register Transfer Language и это, по понятным, причинам в основном мелкие, peephole, оптимизации. Так что возможности анализа самого алгоритма мало зависят от целевой архитектуры.

Кстати, тот же исследователь смог получить root доступ на Linux машине, используя недокументированные инструкции. Выступление называется «GOD MODE UNLOCKED — Hardware Backdoors in x86 CPUs».
Все еще будет NULL. 0, (void*) 0 и NULL — это null pointer constant.
An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant. — C11 6.3.2.3.3
У Numberphile есть два прекрасных видео, посвященных числу Грэма: What is Graham's Number и Graham's Number (how big). Кстати рассказывает о числе сам Рон Грэм.
Это обсуждается в комментариях к оригинальному посту:
Вопрос
Thank you for this great tutorial very much. I followed this and made it work. However, my result is not exactly what I expected before. This outline should perfectly wrap the shape of our model, right? The thickness of outline should keep the same, right? However, in my implementation, when viewing the model in different direction, the outline changes its thickness. And actually, I didn't find one view that can show the outline correctly. Some part of outline is apparently thicker than other parts. And some parts even disappear. I think this results from wrong scaling, but I have no idea about how to fix it. Do you have some ideas? Or do you think this method only works for some regular primitives?
image

Ответ
Hi Zheka,
I have the same thoughts as yours. This method works for the tutorial because the cube is a regular mesh. However, for the bunny, scaling works somehow incorrectly in some directions.
Actually, I fixed this problem in another method. The basic idea is that we scale the bunny by moving all vertices outwardly along the normal direction. Here is my result by this method.
image
Всем спасибо, поправил.
"Пока что, выглядит не очень хорошо". Так будет правильно?

Информация

В рейтинге
Не участвует
Зарегистрирован
Активность