Cabbage Logo
Back to Cabbage Site

3d objects in gui

I recently started using blender with the additional cad package.
I was just wondering about the options regarding 3d objects as elements in a gui.
I figured I’d need a perspective that changes along an axis parallel to the view straight at the gui, so like a dial in a way.
Also, any umportant pros / cons as for blender vs unity or others ?

Warning might be mis-information, as far as I know you wouldn’t be able to use Blender models in Cabbage (you could render them to images and use those, there are some fun examples in this repository https://github.com/micah-frank-studio/Lore), if you REALLY wanted to do something like that you can use svgs and write your own 3d rendering system around that, but, ahem, could be a bit of work and be quite inappropriate and have some performance hurdles to overcome.

You can import Blender models into Unity and link those to sounds generated in CSound, Unity is a realtime 3d engine. Blender is more focused toward 3d modelling and animation (confusion: although there was a 3d engine which has since been removed).

Hope that might help you get orientated with these software

1 Like

yeah, I guess the original question was more about Blender vs Unity or? Blender and Unity are a powerful combo. Design your 3d models in Blender and bring them into Unity, add a splash of Csound and can’t go wrong :slight_smile:

1 Like

I think this really depends on the type of application that you want to distribute.
If it is a VST/AU, then Unity is out of scope, and you will have to build something with svgs like @David_Harris suggests (it looks very hard) or on top of Cabbage, integrating some 3D content using JUCE calls like this (https://docs.juce.com/master/classLowLevelGraphicsContext.html, again also this looks very hard).

If you’re thinking of a standalone app (desktop or mobile) that doesn’t have to live in a DAW then yes, Unity and CsoundUnity can help with that.
In case, I suggest you to export a .fbx from Blender into Unity, but also the .blend format is supported if you have Blender installed.

First, thank you all for your replies.

It is for a VST, more specifically there is a guitar on the GUI from the front view 2D perspective (like someone with a guitar in front of you) and turning its tuning pegs might look better on this perspective if the pegs actually rotate around their axis.
So it’s actually a constant projection on a 2D perspective from the 3D object.
I just finished and colored the moving part of the tuning peg in Blender.

II’ll keep this post updated when I’m further on the matter.

Ah, the fact that you posted in the Csound for games section threw me off. I’m afraid Cabbage has no way of showing 3d UIs in a VST. What you can do however is create a filmstrip of the tuning pegs moving, and then animate that in Cabbage. Not true 3D but should give the same effect.

1 Like

Hi Rory,

Is that the SVG route if I’m not mistaken ?

Thanks again.

No, in this instance you simple grab the animation frame by frame and then use a slider to moves through the frames. You can use the slider’s filmstrip() identifier. :+1:

But the animation is actually the knob/slider or I paste an invisible slider over it ?

No one will see the slider. All you will see is the images. If users want to interact with the tuning pegs they can simply click on them and drag, as you would a slider, but they won’t see a slider if you know what I mean. Check out the KnobManSlider example in the misc examples.

Ok,
So would unity still be needed as an inbetween step ?

No you don’t need Unity, you just need to export the blender animation as a collection of frames, and use those .pngs (or jpegs?) in the filmstrip. Not sure how to do it though since I don’t know blender at all :smiley:

Ok,
Then I first need to figure out the animation in blender.
Thx



Showing individual images are fine, but somehow the filmstrip doesn’t show me the entire image.
What am I missing ?
Also, hslider seems most suitable in this instance.

tuning peg test.csd (721 Bytes)

Did you prepare a film strip? i.e, a vertical or horizontal image with each frame stacked on top of each other? If you send it to me I can try it. Or simple zip all those images and I can create something out of that…

I think a rotary slider would work best here, where its bounds is set to match that of a single frame…

I transformed the object a half turn (animation) and exported that as an image sequence of 100 frames (1.8 ° turn each) with an additional 10 frames as padding (110 frames). So they should all blend over each other as you can see in the file folder.
It isn’t however yet cropped and compressed.
How do I send the zip?

Just attach the zip to your message. If it’s too large you can dropbox it or onedrive, or wetransfer, etc…

The zip is 200 mb so a onedrive link
https://1drv.ms/u/s!Ajcl_DBooH3wvjoqEaXNpRzsO_He?e=PObhZv

Here you go, this uses an image and a slider. If you want to use the filmstrip method you will need to prepare a filmstrip image. If you run this .csd from the directory containing those images it will work out of the box.
tuner.csd (845 Bytes)

thank you very much !
I guess the filmstrip is more efficient of doing ?