Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line export #2

Open
RomSunZ opened this issue Aug 19, 2017 · 2 comments
Open

Wrong line export #2

RomSunZ opened this issue Aug 19, 2017 · 2 comments
Labels

Comments

@RomSunZ
Copy link

RomSunZ commented Aug 19, 2017

I have a 3-segment line with 3ds max coords:
0.88521 3.23816 1.952
0.00000 2.38316 4.100
-0.88521 3.23816 1.952
But inside obj file after export I get this weired coordinates:
VLINE -1.95200 6.69064 -1.07349 0.50000 0.50000 0.50000
VLINE -4.10000 5.83563 -1.95870 0.50000 0.50000 0.50000
VLINE -1.95200 6.69064 -2.84391 0.50000 0.50000 0.50000

And also there is a problem with IDX section in case if model have both polys and lines.
In this case vertex index order for lines may not be the same as for polys.
For example in my model IDX sections starts as: IDX10 2 1 0 3 0 1 6 5 4 7
And if I have for example 2 lines with 3 segments in each I will have a problem. Instead of ids order for lines "0 1 2 3 4 5" I get "2 1 0 3 0 1" and lines will not draw correctly.
Solution is simple: change POINT_COUNTS section and increase indices count as poly cnt + line cnt and add separate IDX for lines in the end of IDX section.
You can see it here: https://forums.x-plane.org/index.php?/forums/topic/48604-vt-records-and-vline-records-and-indices/#comment-539252

Would be nice if you could fix this two annoying bugs.

@RomSunZ
Copy link
Author

RomSunZ commented Aug 20, 2017

Also for lines I found that if line have several segments you need to set index for each vertex of each segments:
this works:

A
800
OBJ

TEXTURE
POINT_COUNTS 3 3 0 7
VT -0.330002 0.380005 0.000000 0.000000 0.000000 -1.000000 0.523254 1.000000
VT -0.779999 -0.199997 0.000000 0.000000 0.000000 -1.000000 0.000000 0.033340
VT 0.080002 -0.220001 0.000000 0.000000 0.000000 -1.000000 1.000000 0.000000
VLINE -0.970000 0.080000 0.000000 1.000000 1.000000 1.000000
VLINE -0.820000 0.800000 0.000000 1.000000 1.000000 1.000000
VLINE -0.0000 0.800000 0.000000 1.000000 1.000000 1.000000
IDX 0
IDX 1
IDX 2
IDX 0
IDX 1
IDX 1
IDX 2
ATTR_no_cull
TRIS 0 3
LINES 3 4
```
`
and this does not:
`
A
800
OBJ

TEXTURE
POINT_COUNTS 3 3 0 6
VT -0.330002 0.380005 0.000000 0.000000 0.000000 -1.000000 0.523254 1.000000
VT -0.779999 -0.199997 0.000000 0.000000 0.000000 -1.000000 0.000000 0.033340
VT 0.080002 -0.220001 0.000000 0.000000 0.000000 -1.000000 1.000000 0.000000
VLINE -0.970000 0.080000 0.000000 1.000000 1.000000 1.000000
VLINE -0.820000 0.800000 0.000000 1.000000 1.000000 1.000000
VLINE -0.0000 0.800000 0.000000 1.000000 1.000000 1.000000
IDX 0
IDX 1
IDX 2
IDX 0
IDX 1
IDX 2
ATTR_no_cull
TRIS 0 3
LINES 3 3
`

@Pancir
Copy link
Contributor

Pancir commented Aug 24, 2017

Thank you for the report.
The lines are not recommended for using and their fate in the plugin is still unknown.
Instead simple splines you can use renderable ones with Edit Mesh or Edit Poly modifiers over it.

@Pancir Pancir added the bug label Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants