-
Notifications
You must be signed in to change notification settings - Fork 17
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
Positions for 3D objects #59
Comments
"Translation" here is synonym to "Position" |
Ah it seems like they merged the function to change the position and set the position into a single function since the widgets initiate at the origin. Thanks! |
Yes its addTranslation() Also think of it as moving instead of setting a position as if you do another addTranslation they will add up, so calling modifierIndex = widget.addTranslation(0, 2, 0)
widget.updateModifier(modifierIndex, 0, 4, 0) |
Are the modifiers ordered in the same way they are shown in the wiki? Might be nice to have named constants for them |
no, they are executed and get their index in the order you add them to a widget, so you have to store their index if you want to modify them later. -- this example would draw the widget 2 blocks above and then rotate it
modifier1 = widget.addTranslation(0, 2, 0)
modifier2 = widget.addRotation(45, 0, 1, 0) -- this example would rotate by 45° and move in that angle 2 blocks away to draw the widget
modifier1 = widget.addRotation(45, 0, 1, 0)
modifier2 = widget.addTranslation(0, 2, 0) so changing in which order you add the modifiers can significantly change the render result. old openglasses1 behavior can be easy wrapped with a small lua lib which uses fixed modifiers like you mentioned before, and just updates them when necessary. btw. all add Modifier methods return their index. so if you just want to keep track of one for later usage you dont have to count them, just store it somewhere -- add green color
myColorModifier = widget.addColor(0, 1, 0, 0)
-- some code [...]
-- change the green to red color
widget.updateModifier(myColorModifier, 1, 0, 0, 0) |
I am going through the wiki but I was unable to find functions to set positions of 3D objects like cube3D. Is there a way to do this or is it a work in progress? It seems like OCG1 had functions to set positions but those don't seem to exist anymore
The text was updated successfully, but these errors were encountered: