Style = same as the style attribute used in the model-viewer tag. You will need to play around with the values to find the perfect one for your model. Example: hotspot-hand (a clickable area in the hand of the model)ĭata-position = The x,y and z coordinates that we will use to position the hotspot. This MUST start with hotspot- otherwise it won’t work. It will give the button an identity and the button will follow the model as it moves. OnClick = This is the common event/js function to be triggered when the button/hotspot is clicked. Let’s look at the button tag and its attributes: So that when the player inspects them, different common events can be triggered. We will also use buttons to create clickable areas in the model. The other ones don’t really matter so I won’t explain them. In my case its inside the models folder that I made so the source is “models/model_name.glb” Doesn’t accept values.Īuto-rotate-delay = How long should the model wait before starting to rotate. I set this to “none” but if you want it you can set it to “auto”Īuto-rotate = turns on auto rotation. Interaction-prompt = Whether there should be a little hand pointing to the model to tell the user to interact with it or not. “Lazy” doesn’t show the model till it’s interacted it. “Eager” makes the model show as soon as it’s loaded. Rotation-per-second = How many times the model will rotate per second. There are many properties that we can assign using the style attribute but we will mainly use width, height, left and top. Having an id is very useful as you can use it to control different properties of the element from the outside via javascript. Id = The name/identity that’s given to an element. I put this globe in a new folder in the root folder named 'models'.īrief explanation of the tag and attributes Put your glb model in a separate folder just to keep your project files organized. If you can’t, then your model needs scaling. Before you scale your models though, load it up and see if you can see a red block (if you follow my instructions and put in the exact same style I will give you later on). But I usually scale it up like, 10x, 100x, 10x XD So, very large. How large I can’t really say since I sometimes use pmx editor for quick edits and it’s a very simple editor so I have no idea about the scale. Blender 2.8+ has built-in support for glTF files. If you have Microsoft’s 3D viewer installed, the model viewer can be converted to a glb model without any hassle. And always keep notes where you got the model from. So convert it if your model doesn’t come in that format. It came in a bunch of formats but what we need is a. For this tutorial I just went to archive3D and got a globe.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |