Hi @John
Apologies for the slow reply, I’ve tried to take a few days away from the keyboard. Anyway…
Thank you, that’s a great help and I’m getting results playing with it (multiple models on the screen, some moving independently others under your control) and thrown in a few other things.
But I’d be lying if I actually understood completely, so some questions if you don’t mind. Apologies if they’re a bit stupif…
-- Create a new entity for the frog
frog = scene:entity()
frog.scale = vec3(1,1,1) * 0.05
How big are models created in the editor? I created a 15*15 model and needed similar scaling to get it to a reasonable size. Obviously I can go blindly with this and just play around until my models look right, but I just wondered how a model related to the scene by default.
-- Create a new entity for the frog
-- Create an entity to display the frog's voxel model and parent to the
-- Add a volume component (displays voxel models)
-- Load an existing model from the Froggy project (any model created
So these stages need to be done for every model you want to display? I’ve just repeated this with a frog2 = scene:entity() and get a second model.
What if I wanted 10, Could you do a loop and have an array, sorry table(?) of frogs and reference them frog(1), frog(2)?
-- Offset the entity's local position based on the size of the voxel model so that it is centered
model.position = -vec3(v:size()) * 0.5
frog.z = 5
OK, I have no clue how this puts the model into the middle of the screen!
If frog.z is setting the z coordinate. Why can’t you use frog.x and frog.y to position the frog?
Later on you position the frog with:
local p = vec3(touch.x, touch.y, 5)
frog.position = scene.camera:get(craft.camera):screenToWorld(p)
Can you position the frog using this principal in the setup code? I tried and didn’t seem to be able to. Obviously I was replacing the touch.x/y with more meaningful variables.
frog.rotation = quat.eulerAngles(angle, angle, angle)
OK, this just works, but why do you need quat.eulerAngles and not just put in the angles?