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

添加新扩展 #273

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

添加新扩展 #273

wants to merge 8 commits into from

Conversation

lazytong-tech
Copy link

制作了一个3D引擎扩展。扩展的文档正在同步编写。测试了一下,应该没问题

@fath11
Copy link
Contributor

fath11 commented Jul 30, 2024

what advantages does this extension offers over #269 ?
they have lighting and the rendering is done inside the original canvas

@lazytong-tech
Copy link
Author

It does not call the graphics card, only uses formulas for pseudo 3D rendering, making compatibility more friendly

@lazytong-tech
Copy link
Author

It also supports custom models and provides some preset models, and it can be compatible with other extensions that need to cover the stage

@fath11
Copy link
Contributor

fath11 commented Jul 30, 2024

It does not call the graphics card, only uses formulas for pseudo 3D rendering, making compatibility more friendly

webgl is supported on all modern browsers, and I realized that the extension doesn't have texture support? this makes this extension nothing more than all the 3d engines that already exist

@lazytong-tech
Copy link
Author

But all pseudo 3D engines based on the same principle do not support textures. The custom model in this extension can create textured graphics through nodes

@lazytong-tech
Copy link
Author

Its usage threshold is lower because most people do not have the ability or time to create models for their own works

@lazytong-tech
Copy link
Author

Some mobile devices have low configurations and cannot smoothly use WebGL

@fath11
Copy link
Contributor

fath11 commented Jul 30, 2024

this might be a good middle ground between RenderTheWorld and a custom 3d engine but i still think RenderTheWorld should be prioritize as the extension has been in review for a year now.

i can teach you how to draw the 3d canvas inside Gandi's canvas if you want. Maybe having it as an option in the extension would be nice.

@lazytong-tech
Copy link
Author

Okay, I will open source this project and its internal engine code to my Github account and create an issue in that repository

@lazytong-tech
Copy link
Author

i created an issue at lazytong-tech/Cube#1, about how to draw the 3d canvas inside Gandi's canvas.

@FurryR
Copy link
Contributor

FurryR commented Jul 31, 2024

不允许上传混淆后的代码。

@lazytong-tech
Copy link
Author

这个代码没有经过混淆,当时使用babel进行压缩后就一直在这个状态进行开发的,是原始的版本

@lazytong-tech
Copy link
Author

后面再进行修改也是直接在这里修改的

Copy link
Contributor

@MoreBugOfDog MoreBugOfDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended not to encode the text, which may cause trouble to the reviewer. I'm working on that, too.

Copy link
Contributor

@MoreBugOfDog MoreBugOfDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg, what are these variable names? ! Unable to read code effectively.

@lazytong-tech
Copy link
Author

At the beginning of this engine, there was too much redundant code, so I compressed it using Babel. The subsequent development was built on top of this compressed version, which is the version I see now. You can choose not to read the definition of this.Cube. this.Cube is just a built-in core rendering engine, I uploaded it to https://github.com/lazytong-tech/Cube.

@lazytong-tech
Copy link
Author

You can install the remote extension (I have uploaded it at https://lt.js.org/file/Cube.js ) to test if it is usable. The custom model is not yet complete, and I will explain how to create a custom model in the documentation being written.

@lazytong-tech
Copy link
Author

This means skipping the content from line 25 to line 831

@lazytong-tech
Copy link
Author

This is the core engine before compression, which is exactly the same as the current one except for the renderer: https://lt.js.org/file/lt3.js

@FurryR
Copy link
Contributor

FurryR commented Aug 1, 2024

这个代码没有经过混淆,当时使用babel进行压缩后就一直在这个状态进行开发的,是原始的版本

不允许上传一切混淆后的代码(允许转译器,但禁止混淆变量名)。此外,建议使用 https://github.com/FurryR/scratch-ext 进行 多文件 Gandi IDE 扩展开发,有效遵循上述限制。

@lazytong-tech
Copy link
Author

lazytong-tech commented Aug 1, 2024

未被重命名变量的核心部分可在https://lt.js.org/file/lt3.js 找到,是this.Cube的代码

@lazytong-tech
Copy link
Author

这个扩展是单文件的,所有的核心部分(包括自制的VM)都在this.Cube内,调用的部分是可读的

@lazytong-tech
Copy link
Author

核心引擎在以前进行了压缩优化,后面的开发是在优化后的基础上进行的,所以我现在也没有未经优化的最新版本

@lazytong-tech
Copy link
Author

lazytong-tech commented Aug 3, 2024

重构了部分代码,还原了大部分被转换的变量

Copy link
Author

@lazytong-tech lazytong-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@MoreBugOfDog MoreBugOfDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since your code has undergone variable obfuscation or other changes that cause variables to not be semantic, I can't read your code properly! I think this may not pass the review because the review team can't determine if this extension contains malicious code (although on the surface it doesn't, and I don't want to think so, it's just to be on the safe side)
The details are up to the official Gandi-IDE team, I'm just a regular community extension developer.

void (window.tempExt = {
Extension: class {
constructor(e) {
console.log("%cLazyTong's Cube\n----------\n    ▃▆█▇▄▖\n      ▟◤▖   ◥█▎\n   ◢◤  ▐     ▐▉\n  ▗◤   ▂ ▗▖  ▕█▎\n ◤ ▗▅▖◥▄ ▀◣  █▊\n▐ ▕▎◥▖◣◤    ◢██\n█◣ ◥▅█▀    ▐██◤\n▐█▙▂    ◢██◤\n◥██◣    ◢▄◤\n   ▀██▅▇▀\n----------\nVer 1.2\nhttps://lt.js.org ", 'color:green;font-weight:bolder');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should you output your extension flags in the console? To publicize your extension? This is highly discouraged. You should only use the console as a platform for outputting uncontrollable errors, and only for debugging errors caused by user usage in partially unpredictable situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants