English 中文(简体)
Troubles parsing Potfront .obj texture cu
原标题:Troubles parsing Wavefront .obj texture coordinates

我把我自己在开放的GL ES 2.0的斜线上 co下来,以便更好地了解这一开放式车辆是如何运作的。 穿透镜,显示其有外缘的模型,就象一个药店。 仅略微说明:我用指数缓冲。

真正的问题是绘制地图。 由于你略微看到下面几处下降,我的文.已经勾画了应该怎么办。

这里我想到的是,如果我错了的话,请更正我:“f”-条线描述一面,即斜坡之前的号码界定了阴ex指数和闪电后的数字。

考虑以下文件:

v -75 75 -50
v 75 75 -50
v -75 -75 -50
v 75 -75 -50

vt 0 0
vt 0 1
vt 1 1
vt 1 0

f 4/3 3/2 1/1
f 2/4 4/3 1/1

案文如下:

512x512 Texture

Now, when I position the vertices in OpenGL ES 3D space and try to map the texture coordinates to each individual vertex, the mapping goes wrong. I could fix this by moving around some of the texture coordinate values but I realise this isn t the way to do it. I also tried to edit some of my .obj exporter settings to flip axises and/or uv mapping around but non of them result in a correct mapping. Is there something I m missing in my theory concerning the .obj file format? One thing I might say already: I read yesterday that the coordinate system of the .obj format defines topleft as the anchor point of a texture. So I fixed that already in my parsing.

Here s a small summary with the current situation: Update: the coordinate system of the texture is the actual .obj texture coordinate system and NOT OpenGL s coordinate system. I translate the coordinates in my parsing algorithm to counter this.

https://i.stack.imgur.com/FW4e1.png” alt=“Summary”/>

最佳回答

I m going to answer my own question: the problem seemed that I was using an index buffer to speed up performance, but my texture coordinates were still mapped to the original vertices.

问题回答

我知道,你报告的协调制度不是正确的。

Actually it is something like this:

“Coordination

I know this is not probably the actual response to your question but I hope it sheds some light on it.

I found the similar problem parsing .obj files. In my case it seems that my .obj files use inverted V (2nd texture coordinate) axis. I solved the problem with this line of code. v = 1.0f - v;

Maurizio在露天彩色坐标的代表性上是正确的。

By looking at your pictures I d say that you should take a better look at your objC code. Assuming the .obj is correctly exported by C4D, it looks like you have your texture indices mixed up.

Plausible proof: switch the bottom left vertex with the bottom right vertex in the picture you posted ("Result Opengl") and your texture would come out right.

EDIT:实际上,过错可能出现在你的文本装货编码中,但这就解释了你重新获得的结果。 即便在装货时有过错,但正文只是显示down倒(由于左下层露面协调系统)。 建议:在您的法典中转换成0和3。





相关问题
Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

How to get instance from string in C#?

Is it possible to get the property of a class from string and then set a value? Example: string s = "label1.text"; string value = "new value"; label1.text = value; <--and some code that makes ...

XML DOM parsing br tag

I need to parse a xml string to obtain the xml DOM, the problem I m facing is with the self closing html tag like <br /> giving me the error of Tag mismatch expected </br>. I m aware this ...

Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

Locating specific string and capturing data following it

I built a site a long time ago and now I want to place the data into a database without copying and pasting the 400+ pages that it has grown to so that I can make the site database driven. My site ...

热门标签