inventivetalentdev / minerender Goto Github PK
View Code? Open in Web Editor NEWQuick, Easy, Interactive 3D/2D Renders of Minecraft
Home Page: https://minerender.org
License: MIT License
Quick, Easy, Interactive 3D/2D Renders of Minecraft
Home Page: https://minerender.org
License: MIT License
I see animated demo on https://minerender.org/demo/skin/
but where is option to enable animation? here https://minerender.org/#getting-started
I found on demo skinRender event:
document.body.addEventListener("skinRender", function (e) {
var t = (Date.now() - startTime) / 1000;
e.detail.playerModel.children[2].rotation.x = Math.sin(t * 5) / 2;
e.detail.playerModel.children[3].rotation.x = -Math.sin(t * 5) / 2;
e.detail.playerModel.children[4].rotation.x = Math.sin(t * 5) / 2;
e.detail.playerModel.children[5].rotation.x = -Math.sin(t * 5) / 2;
});
but when i'm rendering, this event never happens
My code:
var skinRender = new SkinRender({
/* options */
autoResize: false, // Whether to automatically resize the canvas
controls: {
enabled: false, // Toggle controls
zoom: false, // Toggle zooming
rotate: false, // Toggle rotation
pan: false // Toggle panning
},
canvas: { // Dimensions the canvas starts off with (undefined -> use window size)
width: 400,
height: 400
},
render: {
taa: true
},
pauseHidden: false
}, document.getElementById("mySkinContainer"));
var startTime = Date.now();
document.body.addEventListener("skinRender", function (e) {
var t = (Date.now() - startTime) / 1000;
e.detail.playerModel.children[2].rotation.x = Math.sin(t * 5) / 2;
e.detail.playerModel.children[3].rotation.x = -Math.sin(t * 5) / 2;
e.detail.playerModel.children[4].rotation.x = Math.sin(t * 5) / 2;
e.detail.playerModel.children[5].rotation.x = -Math.sin(t * 5) / 2;
});
skinRender.render(skinURL);
Any idea why event "skinRender" never happens or how to modify playerModel?
Given the schematic viewed below (made in 1.12.2), and the provided code to load this schematic, the output is not correct as blocks are missing.
This issue is caused by problems with the legacy mapping of ID that are >= 128. This issue seems related to incorrect handling of signed and unsigned numbers (block IDs are unsigned). The browser console outputs:
Note that the ID of sandstone stairs is 128, which in the case of signed integers results in -128 (256 - 128 = 128).
Note that the ID of terracotta is 159, which in the case of signed integers results in -97 (256 - 159 = 97)
This issue seems to be related to the NBT handling, as seen in this issue of the prismarine-nbt library, which is used for this: PrismarineJS/prismarine-nbt#14.
Code used for generating the schematic:
window.modelRender = new ModelRender({
showAxes: false,
showGrid: false,
autoResize: true,
showOutlines: false,
centerCubes: true,
mergeModels: true,
camera: {
type: "perspective",
x: 100, y: 200, z: 100,
target: [0, 0, 0]
},
sendStats: true
})
let modelConverter = new ModelConverter();
modelConverter.schematicToModels({
url: "/test.schematic"
}, function (models) {
modelRender.render(models);
});
How about rendering wings from http://www.9minecraft.net/cosmetic-wings-mod/ ?
Thank you for the library,
I was wondering if it's possible to render skins with items equipped? For example render a skin that is holding a diamond sword or wearing armor? I feel that it may be out of scope for this library but figured I'd ask before setting out to do it from scratch
Hi, as I mentioned on the discord server, some body parts in the skin renderer are displayed in the wrong place, and some of the faces are flipped or rotated.
It happens with all the skins, its just unnoticeable for most of them because the legs and arms are usually almost mirrored and the flipped faces are mostly hidden.
I used the skin below to check what parts are messed up and i made a list of them, which is in the attached file.
The white parts of the skin should always be on the right and the blue parts on the left. The red letters should be displayed on the correct face and not flipped. On the bottom and top faces, the 2 red pixels should be closer to the left side and the front side of the skin.
How to make the block spin? like in the main website.
Currently, Tile Entities are rendered as planes because of the missing "elements" property in their JSON data.
/ https://mcasset.cloud/1.13.2/assets/minecraft/models/block/skull.json
Hello youre project is awesome but its possible to export to a png file the skin with a pos ?
Is your feature request related to a problem? Please describe.
When I go to the Demo Site (https://minerender.org/demo/skin/#Niceattack) the Skin Viewer will not show the Skin correct. The Skin uses transparency on the second skin layer.
Describe the solution you'd like
Please add the possibility that the Skin Viewer can also display skins correctly with transparent elements.
If one requests embed/skin?skin=xxxx, it redirects back to http to add the / before the ?skin as /skin/?skin
However, this hop jumps to the http site before going to https, breaking the iframe
Was able to fix it on my end obviously by just adding the slash, but figured I'd report it.
>>> curl -vLk 'https://minerender.org/embed/skin?skin=Aikar&shadow=true&overlay=true'
* Trying 104.27.184.162...
* Connected to minerender.org (104.27.184.162) port 443 (#0)
...
> GET /embed/skin?skin=Aikar&shadow=true&overlay=true HTTP/1.1
> Host: minerender.org
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 05 Nov 2018 22:48:55 GMT
< Content-Type: text/html; charset=iso-8859-1
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: __cfduid=d3bb405f5dde8c9b4ac2743c02bbc5dda1541458135; expires=Tue, 05-Nov-19 22:48:55 GMT; path=/; domain=.minerender.org; HttpOnly; Secure
< Set-Cookie: 300gpBAK=R4178756556; path=/; expires=Mon, 05-Nov-2018 23:56:16 GMT
< Set-Cookie: 300gp=R2224672823; path=/; expires=Mon, 05-Nov-2018 23:56:16 GMT
< Location: http://minerender.org/embed/skin/?skin=Aikar&shadow=true&overlay=true
...
<
* Ignoring the response-body
* Connection #0 to host minerender.org left intact
* Issue another request to this URL: 'http://minerender.org/embed/skin/?skin=Aikar&shadow=true&overlay=true'
* Found bundle for host minerender.org: 0x5605bc9faf20 [can pipeline]
* Trying 104.27.185.162...
* Connected to minerender.org (104.27.185.162) port 80 (#1)
> GET /embed/skin/?skin=Aikar&shadow=true&overlay=true HTTP/1.1
> Host: minerender.org
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 05 Nov 2018 22:48:55 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: max-age=3600
< Expires: Mon, 05 Nov 2018 23:48:55 GMT
< Location: https://minerender.org/embed/skin/?skin=Aikar&shadow=true&overlay=true
< Server: cloudflare
< CF-RAY: 4752dee1e78d9f9c-IAD
<
* Ignoring the response-body
* Connection #1 to host minerender.org left intact
* Issue another request to this URL: 'https://minerender.org/embed/skin/?skin=Aikar&shadow=true&overlay=true'
* Found bundle for host minerender.org: 0x5605bc9faf20 [can pipeline]
* Re-using existing connection! (#0) with host minerender.org
* Connected to minerender.org (104.27.184.162) port 443 (#0)
> GET /embed/skin/?skin=Aikar&shadow=true&overlay=true HTTP/1.1
> Host: minerender.org
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
...
The Recipes are not working, i'm getting the following error: https://pastebin.com/sCFFjU39
Consol Log:
Uncaught TypeError: e.result is undefined
MineRender 1.2.3/dist/gui.min.js:37
<anonymous> file:///E:/Benutzer/Documents/Xampp/htdocs/P_53b1/demo.html:24
jQuery 6
i
fireWith
A
c
send
ajax
<anonymous> file:///E:/Benutzer/Documents/Xampp/htdocs/P_53b1/demo.html:22
gui.min.js:37:147395
recipe https://cdn.jsdelivr.net/gh/InventivetalentDev/[email protected]/dist/gui.min.js:37
<anonym> file:///E:/Benutzer/Documents/Xampp/htdocs/P_53b1/demo.html:24
jQuery 6
i
fireWith
A
c
(Async: EventHandlerNonNull)
send
ajax
<anonym> file:///E:/Benutzer/Documents/Xampp/htdocs/P_53b1/demo.html:22
Html Code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/96/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/InventivetalentDev/[email protected]/dist/gui.min.js"></script>
<div id="myRecipeContainer"></div>
<script type="text/javascript">
$.ajax("https://assets.mcasset.cloud/1.13/assets/minecraft/recipes/rail.json").done(function (recipe) {
var guiRender = new GuiRender({/* options */}, document.getElementById("myRecipeContainer"));
guiRender.render(GuiRender.Helper.recipe(recipe, {
/* Some recipes require extra data to map the correct textures */
"rail": "/blocks/rail_normal"
}))
});
</script>
Whats the name of the package? How do I npm install it to use it in my own project? Where do I find an example of usage?
Hi, I'm really interested in using your package inside projects I work on, but it's a real pain to use it inside a headless browser;
Is there any ETA when the TS version will be released? If so, would it be possible to incorporate puppeteer into it?
all.min.js:31
Uncaught TypeError: Class constructor vn cannot be invoked without 'new'
at new e (all.min.js:31:293575)
at all.min.js:31:294394
at Object.<anonymous> (all.min.js:31:310503)
at r (all.min.js:31:158)
at Object.<anonymous> (all.min.js:31:248199)
at r (all.min.js:31:158)
at Object.<anonymous> (all.min.js:31:246861)
at r (all.min.js:31:158)
at all.min.js:31:506
at Object.<anonymous> (all.min.js:31:516)
It looks like that MineRender does not compatibility with the latest version of THREE.js?
I expected the skin - namely the head - to display correctly.
Instead I got a weird display of it.
Note that the head does look normal on the overvier ("Your Skins" section).
NaN
NaN
NaN
NaN
NaN
This was once fixed before but seems to have reappeared.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.
These updates are pending. To force PRs open, click the checkbox below.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
.github/workflows/nodejs.yml
actions/checkout v1
actions/setup-node v1
demo/model/index.html
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
three.js 94@sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=
demo/skin/index.html
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
three.js 94@sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=
embed/model/index.html
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
three.js 94@sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=
embed/skin/index.html
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
three.js 94@sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=
index.html
materialize 0.100.1@sha256-mkKV3FUh67dtli09bVbaYyM1526XgR92cz1uKarE1jo=
prism 1.8.3@sha256-DJJDQyzflMYiUb2jX3gilm9m3gAkHPC4WLv9BAk4rTE=
prism 1.8.3@sha256-DJJDQyzflMYiUb2jX3gilm9m3gAkHPC4WLv9BAk4rTE=
jquery 3.2.1@sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=
materialize 0.100.1@sha256-3mqgTUhHNgfXgjrzjPOaW03DdQ9hgW92BApzLREoRoA=
three.js 94@sha256-NGC9JEuTWN4GhTj091wctgjzftr+8WNDmw0H8J5YPYE=
prism 1.8.3@sha256-haEv2ilTk2sXcJaGbkTtErRCHy/qGt3g+bGbgPf5OTY=
package.json
@johh/three-effectcomposer 0.0.7
debug ^2.6.9
deepmerge ^4.0.0
esdoc ^1.1.0
esdoc-standard-plugin ^1.0.0
java-parser 0.3.2
jquery ^3.3.1
md5 ^2.2.1
nbt-js ^0.1.0
onscreen ^1.3.2
pako ^1.0.6
prismarine-nbt ^1.2.0
stats.js ^0.17.0
three 0.93.0
threejs-ext ^0.92.0
webworkify-webpack ^2.1.3
progress-bar-webpack-plugin 1.12.1
webpack 4.41.1
webpack-cli 3.0.8
worker-loader 2.0.0
Is your feature request related to a problem? Please describe.
Yes, I can't have a cape texture URL in the embedded iFrame of MineRender.
Describe the solution you'd like
I want to add ?cape=
parameter with a URL at the end.
Describe alternatives you've considered
Maybe ?capeUrl=
or ?cape_url=
instead?
Additional context
No.
Describe the bug
When privacy.resistFingerprinting
is true
in about:config
on Firefox
This is not the case with entities and skins without an overlay (for example md_5
).
To Reproduce
Steps to reproduce the behavior:
about:config
in Firefoxprivacy.resistFingerprinting
from false
to true
Blocked https://minerender.org/demo/skin/ from extracting canvas data because no user input was detected.
in the console.Expected behavior
All of the textures should not be like this.
Additional context
This is because Firefox is blocking the getImageData
and the toDataURL
methods because the canvas was not accessed by the user at this state. The error in the console is:
Blocked https://minerender.org/demo/skin/ from extracting canvas data because no user input was detected.
This is more or like a niche bug that only happens to the people that change the about:config
but is something that someone does not expect.
Describe the bug
When trying to resize a skinRender, it throws an "Uncaught TypeError: this._resize is not a function"
To Reproduce
Steps to reproduce the behavior:
Screenshots: https://bit.ly/3x3g9IE, https://bit.ly/2V91BtC
Hey, how do I get it with the recipe to display it like without a ResourcePack?
I found this for the inventory, but it doesn’t seem to be the case for the recipes.
As soon as I specify Conquest as a texture pack it looks like on the screenshot.
https://ibb.co/N6qwc0j
Source Code:
https://pastebin.com/k1zu6bPZ
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
After a full week spend on the documentation, i'm writting this to the support who is managing minerender. Try to give some examples in your documentation young devs are lost in your documentation. Try to implement options that you are using such auto rotation, drop shadow etc etc. On minerender.org you are using several options that aren't detailled in the documentation. So it would be cool to upgrade it and fixe some pages like entityRender ..
Hopefully i can find my answers after an update
Roy
How to add a stone block to an inventory, how to change the amount of an item or how to render a players survival inventory. If you know a answer to one of these questions please post it!
Describe the bug
When using 1.19 assets (see below), it attempts to request the following URL, which does not exist:
https://assets.mcasset.cloud/1.19/assets/minecraft/models/minecraft:block/cube_all.json
However, if we rename "minecraft:block" to just "block," it works fine:
https://assets.mcasset.cloud/1.19/assets/minecraft/models/block/cube_all.json
To Reproduce
Steps to reproduce the behavior:
https://assets.mcasset.cloud/1.19
Expected behavior
No error
Screenshots
N/A
Additional context
I downloaded the embed/model index.html file and manually inserted the assetRoot to the options. This is the URL I used:
index.html?models=block/netherite_block&shadow=false&camera.position=26,26,26&controls=false&controls.rotate=false&controls.zoom=false&controls.pan=false
This issue begins to appear starting at Minecraft 1.16. Minecraft 1.15 works fine.
Tracing further into the code, it appears that post Minecraft 1.15 assets includes the namespace in the asset name which seems to screw up the URLs. I'm implementing a temporary fix on my fork to simply remove these namespaces, but it's definitely jank and wouldn't recommend this as a permanent solution lol
I've searched through the docs and am unable to figure out how to use a custom resource pack. It doesn't seem to be documented very well. I either need to be able to pass in a list of models and base64/url textures, or set up the URL endpoint for a model/texture (though I would prefer the former, as it fits better with my use case).
Could you provide any insight on how the custom resource pack system functions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.