Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Transform gizmo multiple objects

Author
Message
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 16th May 2016 14:11
Hello,

I made an array for storing multiple objects numbers but i want to use the transform gizmo dll in order to manipulate the objects but it reads only 1.

Does anyone know how can I change to move and manipulate multiple objects?

Thank you!

Here is the code:

Alex Matei CEO
www.alexmatei.com
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th May 2016 19:33
Not familiar with the dll you are using, but this makes sense: Manipulate 1 object as normal, then iterate the array to apply the same change to each object?
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 17th May 2016 19:28
I am using this gizmo:

https://forum.thegamecreators.com/thread/199163
Alex Matei CEO
www.alexmatei.com
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 17th May 2016 19:38
It is as Ortu says - but you will have to record the differences of the objects sizes in x,y and z after immediate scaling of single object so as to determine the scaled value - ie get the size before scaling then compare with the new size after scaling, then work out how much it was scaled by before applying the same scales to the multiple selected objects. Don't forget to use the additional flag value for the commands that returns the object size.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 17th May 2016 21:11
I understand that, but how can i do all this in that plugin? I managed to enable that plugin to one object. I thnink its not the matter of the code. Its the matter of that plugin maybe? You should have a look on it if ypu want and see what i am talking about
www.alexmatei.com
James H
16
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 18th May 2016 01:40
Quote: "I managed to enable that plugin to one object"

The demo code it comes with does that for you!
Quote: "You should have a look on it if ypu want and see what i am talking about"

Man, I have had it installed a long time...
Quote: "I thnink its not the matter of the code. Its the matter of that plugin maybe?"

The plugin was designed to deal with one object at a time per call to tg update - you can only have one object ID for the tg set active object command, calling multiple ID's before tg update will only update the last referenced ID still. However when I answered your query I was basing it off my memory and the fact I was using a machine I was fixing which is not set up for DBP and required me to use parts of my own machine to test with, so I couldn't quickly check my own snippets, instead I answered a solution that would definitely work while coupled with the knowledge I have tinkered a few times with the plugin in the past - although it is not the simplest solution. I am back up and running on my own machine now and can tell you it is as simple as this; just call tg update multiple times while changing the value of tg set active object ID's in between, then revert the active object ID back to the one you wish to be rendered before making a final update and render call. Also setting the tg render call several times in exactly the same manner should work in theory, wouldn't be difficult for you to test should you feel the need for multiple renders of the gizmo - though I think it might make things look messy.
Quote: "MateiSoft
User Banned"

Oh dear, earlier I was trying to view your post and was thinking, hang on he shouldn't be on post approval given his join date! I won't ask and it probably not wise to tell either

Login to post a reply

Server time is: 2024-04-20 06:28:22
Your offset time is: 2024-04-20 06:28:22