Place layer at pivot point

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

Dammit! The mix between the two vector styles, extruded tread and layer rims will not play properly together with depth sorting. It's a damn pity too as the lathed tread allowed me to get a curved surface on the top of the tyre which was really cool but as soon as they are rotated the rims just vanish beneath the tread at about 70-80 degree rotation.

EDIT: the layered system I made works well with depth sorting as they are individual layers. The extruded 3D Tread layer looks as if it is being treated as only 1 layer which it is I guess :) so allowing rims to poke through when they are not supposed to.
There's always something that throws a spanner in the works isn't there :evil:

D.K
User avatar
SimplSam
Posts: 1218
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Place layer at pivot point

Post by SimplSam »

synthsin75 wrote: Sat Jul 03, 2021 5:49 am I think I'd go for a mix of the two. The 2D vector wheel face with the 3D vector tread behind it. Best of both. Also fixes the tread going over the side.
I agree, the silvery wheels don't match the rest of the vehicle, but the tyres look better.

The most 'odd' thing now is the thinness of the seat and windshield. And the upper-rear just looks 2D. That maybe a viewing angle/rotation thing - or you need something like a roll bar/cage to keep the illusion of 3D.

Great work.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

Well....I went back and had a look at Maestrals links and they inspired me to think about using bones to model.
Bones make excellent 3D modelling tools without the use of scripts :)

Image

Cheers
D.K

EDIT : Yes SimpleSam. I was wondering about the thick and thin line work too...It's probably a perspective thing. Will try and fiddle with the camera settings.
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

Image
http://www.filedropper.com/3djeepmix

Okay, lathe does work (since extrude doesn't show the image texture on the sides, like you'd need for tire tread). But where lathe only needs a shape on one side, which is lathed around the layer origin, sorting layers by depth doesn't recognize the opposite side as layer content. So I just added another rectangle as close as I could to the other edge of the lathed shape without poking through. This seems let Moho know where the other side of the lathed shape is relative to other depth sorted layers.
User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

Hey that's fantastic Wes!!! I will update the link at the top of the original thread...I just added a small tweak to the tread shapes so they have a bit of curvature at the top.
D.K
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

I thought about adding a bit of curve, but opted to keep it simple as an example. If I were doing this for a project of mine, I might even to a tread profile, but that would be less cartoony.
User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

Yes. I find that Moho's 3D abilities only really lend themselves to 2.5D projects as control of the3D surface settings etc are just non existent. You can easily end up with a vector/3D mix that doesn't work as per the Jeep's 3D wheels. Personally I would prefer less 3D controls and more 2D control over how line work/surface textures are rendered on a 3D object so that they are more suited to 2D vector projects.
D.K
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

I can get a 3D extruded vector wheel to look very close to your original 2D art:
http://www.filedropper.com/3dwheel

You'd still need a lathed tire tread added though, so might as well just use the 2D art.
User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

That looks great Wes!!! Maybe we should start on another model and see where we can push this stuff?
D.K
EDIT: I love how your wheel uses less points. I think we should pull out the spanner and throw those on the Jeep :)
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

That's true, the extruded one does save on layers and points. Hadn't thought of that benefit.
User avatar
DK
Posts: 2891
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Re: Place layer at pivot point

Post by DK »

I think I just found a bug in Moho. Wes I will send you the file to look at.
D.K
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

DK wrote: Sun Jul 04, 2021 4:27 am I think I just found a bug in Moho. Wes I will send you the file to look at.
D.K
There is definitely a bug, where it doesn't update a 3D vector image texture if you change or remove it. Disabling, applying, and reenabling 3D vectors will sort that out. I thought I could write a script to do that, but Moho will not update the layer doing it by script.

And Moho seems to expect image textures with square dimensions, otherwise it will squash the long dimension.
User avatar
synthsin75
Posts: 10253
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Place layer at pivot point

Post by synthsin75 »

I found a way to get the image texture on a 3D vector to update by script (by changing to any other 3D mode, except None, and back). If you change an image texture on a 3D vector shape, just run this menu script to update it:

Code: Select all

-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "Syn_Update3DTexture"

-- **************************************************
-- General information about this script
-- **************************************************

Syn_Update3DTexture = {}

function Syn_Update3DTexture:Name()
	return "Update 3D Texture"
end

function Syn_Update3DTexture:Version()
	return "0.1"
end

function Syn_Update3DTexture:Description()
	return "Update 3D Texture"
end

function Syn_Update3DTexture:Creator()
	return "(c)2021 J.Wesley Fowler (SynthSin75)"
end

function Syn_Update3DTexture:UILabel()
	return "SYN: Update 3D Texture"
end

-- **************************************************
-- The guts of this script
-- **************************************************

function Syn_Update3DTexture:IsEnabled(moho)
	if (moho.layer:LayerType() == MOHO.LT_VECTOR) then
		return true
	end
	return false
end

function Syn_Update3DTexture:Run(moho)
	local layer = moho:LayerAsVector(moho.layer)
	local mode = layer.f3DMode
	if (mode > 0) then
		if (mode < 3) then
			layer.f3DMode = mode + 1
			MOHO.Redraw()
			layer.f3DMode = mode
		else
			layer.f3DMode = mode - 1
			MOHO.Redraw()
			layer.f3DMode = mode
		end
	end
end
Post Reply