Coder Social home page Coder Social logo

Comments (8)

tomysshadow avatar tomysshadow commented on September 10, 2024

This is not an issue I've encountered with the worlds you sent or any of my test worlds. Usually, I test the converter by viewing the result in GLC Player, and it always renders them right side up. For example, here is the 1942 cabinet in its default orientation.

1942

from shockwave-3d-world-converter.

 avatar commented on September 10, 2024

It's not a problem, I just rotate it.

But if you're curious, install Blender (blender.org) and import wavefront (obj) to see it.
I don't understand why glc player is viewing it in another way then blender/godot because it's the same obj file.

Do you have an idea how this is possible?

from shockwave-3d-world-converter.

tomysshadow avatar tomysshadow commented on September 10, 2024

According to Blender's documentation:

Since many applications use a different axis for ‘Up’, these are axis conversion for these settings, Forward and Up axes – By mapping these to different axes you can convert rotations between applications default up and forward axes.

Blender uses Y Forward, Z Up (since the front view looks along the +Y direction). For example, it’s common for applications to use Y as the up axis, in that case -Z Forward, Y Up is needed.

In other words, the Wavefront OBJ format has no method of specifying which axis is up, so it comes down to convention. In the Blender Import dialog, ensure that under Transform, Up is set to Z-Up in order to get the correct behaviour. This preset will also remain saved for future imports.

from shockwave-3d-world-converter.

 avatar commented on September 10, 2024

Thanks! This works. But how did you save the preset? When I restart Blender it's gone :(

from shockwave-3d-world-converter.

tomysshadow avatar tomysshadow commented on September 10, 2024

from shockwave-3d-world-converter.

 avatar commented on September 10, 2024

I still don't understand why there needs to be a Up axis.
If I look in the OBJ, I see each vertex is there with X,Y and Z value.
So if you draw those in any program, shouldn't be the result the same?
Or are different program using different axis for Up so also the other axis are different?
Why don't they use the same axis?

from shockwave-3d-world-converter.

tomysshadow avatar tomysshadow commented on September 10, 2024

The X, Y and Z values are not touched by Shockwave 3D World Converter. They are straight copy pasted from the original world, not rotated or modified in any way. The issue is that 3D modeling tools have historically disagreed on which axis is up.

https://www.reddit.com/r/gamedev/comments/b6ujvb/y_axis_up_or_z_axis_up/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button

As this doc called Which way is up? explains:

There are two common conventions for the "up" vector:

Most 3D modeling software, like Blender, prefers the "up" vector to be +Z.

This is natural if you think about a level map spread on the XY plane. The Z coordinate is representing the height above the ground.

glTF, X3D, default OpenGL camera, and various game engines (Castle Game Engine, Unity3d, Unreal Engine) by default prefer the "up" vector to be +Y.

This makes sense if you think about the screen as being the XY plane. Then if you look straight (in the right-hand coordinate system, as used by X3D, OpenGL and Castle Game Engine) you look in the -Z direction.

One argument in favor of this convention is that the default camera makes sense for both 2D and 3D games. For 2D games, X goes to the right, Y goes up, and Z doesn't matter (or is used to position layers relative to each other). For 3D games, again X goes to the right, again Y goes up, and Z represents the depth. When your game character jumps, the Y coordinate increases — whether it's a 2D or 3D game.

As you can imagine, other conventions are possible, as you can pick any 3D vector as "up", and pick anything orthogonal to it as "direction".

Some 3D model formats work around this by standardizing or explicitly specifying the up axis. For example, Collada DAE has an <up_axis> tag which allows tools to specify which way is up, so it can be automatically detected when importing. Wavefront OBJ however has no such benefit, so 3D modeling tools are left to guess which convention is being used. The coordinates are the same, the difference is which axis is up vs. into the screen.

This explains why GLC Player shows the model upright: it assumes Z-Up. Blender is assuming when you import the model that it is Y-Up and is "helpfully" rotating it to Z-Up for you. You don't want this, so you need to explicitly specify that it is already Z-Up.

from shockwave-3d-world-converter.

tomysshadow avatar tomysshadow commented on September 10, 2024

Closing this because the converter is working correctly and directly copying the coordinates of the original world. The axis needs to be set correctly on import.

from shockwave-3d-world-converter.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.