How can I get the ID of 3d engine elements by the handle?

Everything related to 3D programming
eNano
User
User
Posts: 13
Joined: Wed Jun 05, 2024 4:48 pm

How can I get the ID of 3d engine elements by the handle?

Post by eNano »

Is there a way to find the purebasic ID number of a 3d element (for example a node) by using the handle of that element? I was thinking that maybe there is something similar to form elements IDs.
For example if you need to get the ID number of a button you can write:

Code: Select all

GetProp_(GadgetID(buttonNumber),"PB_ID")

;or 
GetWindowLongPtr_(GadgetID(buttonNumber), #GWLP_ID)

;or the number of a window:
GetProp_(WindowID(windowNumber), "PB_WINDOWID") - 1
is there something similar for 3d elements?
eNano
User
User
Posts: 13
Joined: Wed Jun 05, 2024 4:48 pm

Re: How can I get the ID of 3d engine elements by the handle?

Post by eNano »

Hi! I know there is no answer yet but I need to add some details to my question, maybe someone can give me a clue.
I didn't found any internal function inside pb to manage dynamic parent / child relationships, many 3d engines (including ogre) have the option to get the children count or get the parent of an object or the root object of a scene with the possibility to add/remove objects in the tree without loosing control of each object, this is important for example in objects selections or local/parent/world/referenced transformations.
if I have indexed objects I loose the control of an specific object when I change the list because the indices are redefined, so I can't access that object again without doing an entire iteration on the list again to find a match, I can't find a way to control the objects directly by handle.
Is there a way to use some kind of dynamic parent/child management in 3d objects or maybe a way to access some additional functions in ogre?
User avatar
tft
User
User
Posts: 99
Joined: Mon Dec 29, 2008 9:34 am

Re: How can I get the ID of 3d engine elements by the handle?

Post by tft »

I have written separate procedures for every 3Dengin command that creates or deletes something. Which logs such lists with links in the background. It's actually quite easy to implement.

TFT
TFT seid 1989
Aktuelles Projekte : Driving School Evergarden
YouTube : Pure Basic to go
FaceBook : Temuçin SourceMagic Games
DISCORD : SourceMagic
W10 , i9 9900K ,32 GB Ram , GTX Titan , 3 Monitore FHD
ARDUINO Freak :-)
Post Reply