什么-431602080.000000在GLMmodel顶点值意味着什么? [英] What does -431602080.000000 value in GLMmodel vertex means?

查看:1099
本文介绍了什么-431602080.000000在GLMmodel顶点值意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 GLMmodel 对象以重新present在C ++程序中的谷歌SKETCH UP模式。这些对象具有一个部件(顶点)包含在这样的方法的对象的所有顶点列表:[GLfloat顶点1的x分量,顶点1的GLfloat y分量,顶点1的GLfloat z分量,GLfloat x分量顶点2 ...]。当我读到这些值我得到所有这些小的数字,除了第一三一(第一个顶点的坐标),这是所有三个-431602080.000000。这并不在我的计划是有意义的。我GOOGLE了它,我发现这个值经常出现在C ++程序,但我不知道是什么意思。任何想法?

I use a GLMmodel object in order to represent a Google Sketch Up model in a C++ program. These objects have a member (vertices) that contains a list of all the vertices of the object in a way like this: [GLfloat x component of vertex 1, GLfloat y component of vertex 1, GLfloat z component of vertex 1, GLfloat x component of vertex 2...]. When I read all these values I get small numbers for all of them except for the first three ones (the coordinates of the first vertex) which are all three -431602080.000000. This doesn't make sense in my program. I've googled it and I've found this value appears frequently in C++ programs but I don't know what does it mean. Any ideas?

推荐答案

是的,这是一个魔法值。当你看到与调试器变量,使用十六进制查看,你会看到0xcdcdcdcd。这不是一个偶然的值,即由微软的CRT的调试分配器使用的值。为一体,可能还有其他。它初始化您使用malloc或新的这个值分配任何内存。它不与float类型变量明确或双,当然,更容易整数和字符串和指针特别有用。假设你正在使用的MS CRT,调试分配器魔法值这里记录。

Yes, this is a "magic value". When you look at the variable with the debugger, using hex view, you'll see 0xcdcdcdcd. That's not an accidental value, that is a value used by the Microsoft CRT's debug allocator. For one, possibly others. Which initializes any memory you allocate with malloc or new to this value. It isn't that clear with variables of type float or double of course, easier with ints and strings and especially useful with pointers. Assuming you are using the MS CRT, debug allocator magic values are documented here.

您忘了初始化值。这是在你的code的错误。

You forgot to initialize the value. That's a bug in your code.

这篇关于什么-431602080.000000在GLMmodel顶点值意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆