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

Change camera parameters in the grammar to have meaningful values #17

Open
GMMULLER opened this issue May 26, 2023 · 7 comments
Open

Change camera parameters in the grammar to have meaningful values #17

GMMULLER opened this issue May 26, 2023 · 7 comments
Labels

Comments

@GMMULLER
Copy link
Collaborator

This is how the camera is currently specified in the grammar:

"camera": {
                    "position": [
                        -9753739,
                        5117375.5,
                        2216.08675
                    ],
                    "direction": {
                        "right": [
                            14146.2158203125,
                            100883.421875,
                            2216086.75
                        ],
                        "lookAt": [
                            14146.2158203125,
                            100883.421875,
                            2213086.75
                        ],
                        "up": [
                            0,
                            1,
                            0
                        ]
                    }
                }

Even though that is the parameters used internally they should be exposed in a more friendly way to the user. One way to do that, for example, is using lat/long (EPSG:4326) instead of EPSG:3395 for the camera position. Internally the system still manipulates 3395

@sajal1123
Copy link
Collaborator

I can look into this. Would you like to change the EPSG for the entire project, or just the grammar(and convert it to EPSG:3395 for internal manipulation)?

@sajal1123
Copy link
Collaborator

Hi @GMMULLER, if we add a coordinate conversion from EPSG:4326 to EPSG:3395 in ../dataLoading/data.py, will it work?

@GMMULLER
Copy link
Collaborator Author

GMMULLER commented Jun 1, 2023

Hey Sajal, sorry for the late reply I didn't see the notification. The idea is to change the EPSG just for the grammar and convert it to 3395 for internal manipulation. I'm not sure if I understand what you mean by adding the conversion to data.py. There are two flows of data: (1) the user changes the grammar (2) the grammar is automatically changed by the "link" functionality. Both changes will probably involve GrammarPanel.tsx. But (1) is 4326 to 3395 and (2) is 3395 to 4326. On the end of the day camera.tsx has to receive 3395 and the user see 4326.

@sajal1123
Copy link
Collaborator

I see, by "adding a conversion" I meant inserting a function that converts the EPSG to/from 3395.

I'm currently going over the logic flow in GrammarPanel.tsx file, it looks like we can convert the EPSG from the user friendly format to 3395 in applyGrammar.

Also, did you mean camera.ts at the end?

@GMMULLER
Copy link
Collaborator Author

GMMULLER commented Jun 3, 2023

Yep, that is probably the way to go. Sorry I meant camera.ts haha

@sajal1123
Copy link
Collaborator

Hi @GMMULLER, since the 4326 coordinate system will have only the x and y coordinates, how should the value for the z-coordinate be assigned after converting the input to 3395?

@GMMULLER
Copy link
Collaborator Author

So the z coordinate is not considered in the conversion. It is in meters so you can just attach it to the output. If the input is (x,y,z) the output will be (x',y',z)

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