Giter VIP home page Giter VIP logo

Comments (5)

icarofonseca avatar icarofonseca commented on July 4, 2024

I used some code from my thesis to create a simple ship scaling app, maybe it is useful for this task.

Maybe in the future this app can be expanded with multiple options to edit ship specifications using GUIs instead of forcing the user to edit JSONs directly.

from vesseljs.

EliasHasle avatar EliasHasle commented on July 4, 2024

Thinking about this, rotation belongs with position, which is currently specified in the shipstate, with an option to specify a default for a derivedObject in the derivedObject's referenceState.

Scale, on the other hand, can invariably be considered constant for a given derivedObject, so could be stored on the derivedObject directly. Scale will impact calculations of CG etc., so it can't meaningfully be added without thoughtful consideration. (In fact, that also applies to rotation.)

I must admit that this all seems like a mess, though.

from vesseljs.

EliasHasle avatar EliasHasle commented on July 4, 2024

#87 outlined a way to introduce scale and rotation for derived objects, at the same time moving position into a property. I am not convinced it is the right way, or a prioritized task.

from vesseljs.

hmgaspar avatar hmgaspar commented on July 4, 2024

Ok, we close for now. If necessary, we open.

from vesseljs.

EliasHasle avatar EliasHasle commented on July 4, 2024

As with the object picking, I include here the relevant source files for introducing this.

A version of the DBB CSV to JSON converter that sets position within an object:
https://github.com/EliasHasle/vesseljs/blob/rotation-scale/examples/Utilities/Block_CSV_to_JSON.html

A version of DerivedObject.js that tries to handle position, scale, rotation:
https://github.com/EliasHasle/vesseljs/blob/2b12ed5a04d5b2703cb1dfc1735bfb6453e22e69/source/classes/DerivedObject.js

A different line 67 in ShipState.js:
https://github.com/EliasHasle/vesseljs/blob/2b12ed5a04d5b2703cb1dfc1735bfb6453e22e69/source/classes/ShipState.js#L67

Minor corresponding changes to Ship3D_v2.js:
https://github.com/EliasHasle/vesseljs/blob/2b12ed5a04d5b2703cb1dfc1735bfb6453e22e69/examples/js/Ship3D_v2.js

from vesseljs.

Related Issues (20)

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.