Basic questions

Hello everyone,

I am new to Armory and would like to use it for HTML presentations instead of games.
E.g. a car that I can rotate and zoom in and where I can open the doors by clicking on a hotspot etc.

Of course I searched the forum (and Youtube, search engines and of course the armory_examples etc.) and found a few things, e.g. this one

I was really looking forward to it as there are a lot of things in this project that I’ve been looking for for a long time.
But of course this scene wasn’t compatible either and I couldn’t even play it, let alone use scripts from it.
And it wasn’t just in this scene.
It’s really very frustrating!
And I’m only looking for simple actions, e.g.

  • How can I prevent the camera from passing through an object?
    (I’ve tried camera parent rigid bodies with no success.)

  • How can I move (rotate, scale) something only once by a certain value?

  • Something like an converter for older Scenes

  • Or a (current) tutorial (for Non-Coder) that focuses on HTML presentations and not on games.

Here I have a *.blend where I can rotate the scene (how do I limit the angles?), zoom (how do I prevent the camera from going through the box?) and perform an action on click (how do I prevent that when you click repeatedly, Suzanne turns again)
Sorry, as a new user I can’t upload here.

I hope for some tips and suggestions.

Many greetings
Hans

Win 10 - 21H2
GTX 1070 - Latest StudioDriver
Blender 2.93.9
armory.py is 2022.5.0
And the ArmorySDK-2022-5 is also updated via GIT

EDIT:
Deleted pan the Scene. Found an Example.

Hi and Welcome!

I have tried to answer as much questions as possible below. There is also an example blend file at the end. Hope this helps :slightly_smiling_face:

Cool! This is definitely possible.

I haven’t checked the scene but it might be incompatible because the file was created in an older Armory version.

Below I tackle each issue and provide a blend file at the end.

Zoom and preventing camera going through box:

This can be done by simply checking the distance between the camera and the empty object. If this distance is smaller than some value, don’t move the camera any further, so the camera does not collide with the cube.

Similarly, if the distance is larger than some maximum value, don’t move the camera away. So the user can zoom in and out, but only in a set range

On Click Action:

This is quite simple. In your blend file, you chose Down as the input action for the mouse node:
image

Down means “As long as mouse button is kept depressed”. Started mean “Once when the mouse button starts to depress”

So, the option should instead be Started, like so:
image

Rotation Limits:

As with any game engine or 3D program, rotation management is a bit difficult, especially for beginners. So I made a small node tree that does all the rotation math for you. You only need to set the rotation min/max for the 2 axes.

image

As shown in the above image, you can limit the rotations in Z and Y axes by setting the min/max angles to the 4 variables highlighted in yellow. The values must be set in degrees in the area highlighted in red.

A bit about how rotation limiting works for anyone interested:

Rotation limiting in my setup works using rotation interpolation. Say for example, you want to limit rotation of some object in Z axis between -45° and +45°. What I do is interpolate between -45° and +45° using a control factor.

factor Rotation
0 -45
0.25 -22.5
0.5 0
0.75 22.5
1 45

So I control this factor using mouse inputs. The mouse input changes this factor. The factor always remains between 0 and 1. Hence the rotation changes with the factor but remains within -45° and +45°.

I do the same for the other axis and then combine the two rotations(multiplication) to limit rotation in both axes.

Modified Blend File:
orbiter-zoom-click_modified.blend (1.2 MB)

2 Likes

Hi QuantumCoderQC,
great!

That takes me a bit further already.
Thank you so much for your help.

Many greetings
Hans