Archive 17/01/2023.

Roll a texture in 3D scene

fanchenxinok

hi all,
how to roll a texture 360 degree like a cyclinder without up and down surfaces as following image:
untitled
i try to create a plane model then roll it 360 degree, but nothing change.
// a roll plane
Node* rollNode = scene_->CreateChild(“RollPlane”);
rollNode->SetRotation(Quaternion(-90.0f, 0.0f, 0.0f));
rollNode->SetScale(Vector3(4.0f, 2.0f, 2.0f));
rollNode->SetPosition(Vector3(2.0f, 6.0f, 6.0f));
auto* rollPlane = rollNode->CreateComponent();
rollPlane->SetModel(cache->GetResource(“Models/Plane.mdl”));
rollPlane->SetMaterial(cache->GetResource(“Materials/rollMat.xml”));
rollNode->Roll(360.0f);

could anyone give me a hint, how to use Urho3D API to create it?
best regards!

jmiller

Hi and welcome to the forum! :confetti_ball:

Models/meshes are usually used by engines in final form. CustomGeometry is an option with Urho, as is programmatically creating indexed models, but both have disadvantages.

Data/Models/Cylinder.mdl seems closer to what you want, but it does have end caps.
One could:
Find or model a suitable cylinder with the UV mapping you want. This can be done with e.g. Blender.
Export to Urho MDL. Urho comes with AssetImporter, and there are a couple Blender exporters linked from wiki, with one Blender exporter I have used recently.

:tropical_fish:

dertom

Additional info, ‘roll’ means rotations around the X-axis.

So what you did here was to rotate your model 360deg around x-axis which has obviously no effect.

fanchenxinok

hi jmiller,
thanks for your reply, i will try.
best regards!

fanchenxinok

hi dertom,
thanks for your reply.
best regards!

fanchenxinok

hi jmiller,
i download urho3d-blender-exporter.zip, then i follow readme.md file in this package.
But encounter the following error:

  • ->‘Install…’->[zip]/blender_addons/addon_blender_connect.zip and enable the checkbox

fanchenxinok

also install “Urho3D-Blender.zip” addon encounter the following error:
->‘Install…’->[zip]/blender_addons/Urho3D-Blender.zip and enable the checkbox:

jmiller

According to https://github.com/dertom95/Urho3D-Blender/wiki you may also want to install https://github.com/dertom95/addon_blender_connect to enable the integrated Urho3D renderer. However, neither are necessary with the branches I use (master versions cloned directly to addons/).

fanchenxinok

hi jmiller,

this error happened when install your addon_blender_connect package.
i download the release package of urho3d-blender-exporter.zip from:

i think it is the most recently release addon.

best regards

best regards!

fanchenxinok

hi jmiller,

i modify init.py of addon_blender_connect from:
def register():
defRegister()
bpy.types.World.blender_connect_settings = bpy.props.PointerProperty(type=BlenderConnectSettings)

def unregister():
defUnregister()
del bpy.types.World.blender_connect_settings

to

def register():
defRegister
bpy.types.World.blender_connect_settings = bpy.props.PointerProperty(type=BlenderConnectSettings)

def unregister():
defUnregister
del bpy.types.World.blender_connect_settings

the previous error fixed, but a new error happened:

Traceback (most recent call last):
File “C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\modules\addon_utils.py”, line 382, in enable
mod.register()
File “C:\Users\Administrator\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\addon_blender_connect_init_.py”, line 35, in register
bpy.types.World.blender_connect_settings = bpy.props.PointerProperty(type=BlenderConnectSettings)
NameError: name ‘BlenderConnectSettings’ is not defined

how can i fix it ?
best regards!

jmiller

Ah yes, good…

I am not familiar with this part of the setup, but looking again at Home · dertom95/Urho3D-Blender Wiki · GitHub … maybe pyzmq addon was missed? The addon’s thread and videos might also be useful.

dertom

Yes, I guess @jmiller is right with his suggestion, that it is likely that you did not install pyzqm that this exporter uses. If you really want to use this exporter make sure to follow this instructions on that wiki link. I know, I know,… much hassle for installation.
You know that there is another blender-exporter which is much easier to install: https://github.com/1vanK/Urho3D-Blender/tree/2_80