-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add KHR_interactivity draft #2293
base: main
Are you sure you want to change the base?
Conversation
Great work! What sections are next? Also what could we release as a draft extension for SIGGRAPH 2023? |
ec4a047
to
09bd2cf
Compare
8e44b46
to
151f3ad
Compare
|=== | ||
| Type | `math/pi` | Ratio of a circle's circumference to its diameter | ||
| Output value sockets | `float value` | 3.141592653589793 | ||
|=== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have Pi, we should also have Tau. https://tauday.com/tau-manifesto The value Tau is the circle constant (equal to 2*Pi, or rather, Pi is half of Tau). Using Tau usually results in more readable code. Tau is supported in many programming languages such as C#, Java, Python, GDScript, Rust, Unreal Blueprints, and more, so it's useful for interoperability with other languages, especially Unreal Blueprints which is conceptually similar.
===== Tau
[cols="1h,1,2"]
|===
| Type | `math/tau` | The circle constant, the circumference of the unit circle in radians.
| Output value sockets | `float value` | 6.2831853071795862
|===
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case more justification is needed, the KHR_interactivity document currently contains Degrees-To-Radians (math/rad
) and Radians-To-Degrees (math/deg
). These allow converting between degrees and radians. Tau can be used for a similarly important purpose, dividing or multiplying by this number allows converting between turns and radians, where 1 turn is τ radians. Tau can be used for more than just this, but the point is, if math/rad
and math/deg
are justified as a part of KHR_interactivity for converting angles, then math/tau
is also justified for converting angles.
dc870c5
to
29e8acc
Compare
| `T value` | The custom variable value | ||
|=== | ||
|
||
This node gets a custom variable value using the variable index provided by the `variable` configuration value. The type `T` is determined by the referenced variable. The variable index **MUST** be non-negative and less than the total number of custom variables, otherwise the node is invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are variables accessed by index instead of by name? It would make more sense to me to set a variable called "money"
than one called 27
.
{ | ||
"id": "variable", | ||
"value": [0] | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
If the variable type is custom, the `value` property is defined by the extension defining the custom type. | ||
|
||
== Nodes |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
If the pointer or the pointer template with all its substitutions applied can be resolved, the `value` output value is the resolved property value and the `isValid` output value is true. | ||
|
||
If the pointer or the pointer template with all its substitutions applied cannot be resolved, the `value` output value is the default value for its type and the `isValid` output value is false. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
Intermediate output progress values **MAY** be less than zero or greater than one. | ||
|
||
==== Animation Control Nodes |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closing this one as done, this will be in the text soon
I apologize if this has already been mentioned somewhere. |
A couple of practical questions based on my experiments:
|
My understanding is that the control points specified by an interpolation node are to be used as the control points of a Bézier spline that is used as an easing function, à la cubic Bézier easing functions in CSS and elsewhere. If that's correct, then the implementation would pass the normalized time parameter (on [0, 1]) to the easing function to get the eased progress fraction, then use that as the "time" parameter of the lower-level interpolation routine (whether lerp or slerp). |
Thanks! I found it now. The spec states that it's linear interpolation but also has this remark:
|
Thank you for your response. |
Regarding the question I asked earlier, it seems it might have gotten buried and become hard to notice, so I’d like to ask again. |
This event is defined in the |
Oh, I thought this extension was an attribute to specify whether an object can be selected. I’ll read through the draft. Thanks! |
It's not a self-solution, but is there any issue with this kind of definition?
|
I believe this matches the output of https://github.com/KhronosGroup/glTF-InteractivityGraph-AuthoringTool/tree/initial-work-merge (minus the missing type declarations in your partial file). |
Thank you. |
@Hackn0214 backspace seems to remove just fine? |
|
Is it possible to return the value pointed to by a pointer with the behavior graph? /nodes/{nodeIdx}/mesh -> meshIdx |
If configuration value is array of length 2,3,4 or 16 it could be ambiguous if its vec2/vec3/vec4/vec4x4 or int[], this might not be a problem for JS but is a problem for strongly-typed implementations, is there any recommendation for them how to disambiguate? |
For example, how about specifying the type at the time of the call? |
@Hackn0214 you already can get number of materials when using appropriate pointer , check out core pointers |
That's wonderful! |
I would appreciate it if you could add /meshes/{}/primitives.length |
Rendered version: https://github.com/KhronosGroup/glTF/blob/interactivity/extensions/2.0/Khronos/KHR_interactivity/Specification.adoc