PDA

View Full Version : Is it possible something similar in TBGL



ErosOlmi
28-06-2007, 14:48
http://www-03.ibm.com/innovation/us/index.shtml

in the above page a flash animation is supposed to show something like pheres menues that expand into sub spheres menues if clicked or mouse over.
All pheres are linked together.

Is is possible a similar effect using TBGL? I suppose yes, but, as you know, I'm quite (read a lot :D ) bad in 3D so ...

Thanks a lot
Eros

Petr Schreiber
28-06-2007, 16:52
Hi Eros,

sure :)
Only trouble I can see is how to organize data in some structure to be able to visualise sphere and text web from that.
Let me think about it :)

Bye,
Petr

ErosOlmi
28-06-2007, 17:18
Nothing urgent.
Thanks
Eros

kryton9
28-06-2007, 20:56
I have been looking and thinking about cool interfaces too Eros. I was playing with the MojoWorld Viewer and it has a very simple interface that has the ease of menus without the burden of menus if I can explain it that way.

I love the idea of an object and then sub objects coming out.

Give us UDT's in UDT's and we can do all sorts of cool things!!

type tRGB
r as long
g as long
b as long
end type

type tV3
x as double
y as double
z as double
end type

type tObj
p as tV3
c as tRGB
end type

As you can see we can build quite elaborate setups that will be easier to work with :)

Can we use UDT's in Linked Lists?

One last request: Can you write a little example of a pointer to a function in a UDT and then how that could be used?
Since the question is confusing let me try to write an example in pseudo code

type tV3
x as double
y as double
z as double
end type

type tObj
px as double
py as double
pz as double
m as pointer to the moveObj subroutine
end type

dim ob(100) as tObj
dim mb as tV3

assume here we set values to default locations for all o and also assigned values to m
now we want to use the subroutine in o to update itself

for x =1 to 100
call this.m(ob(x),mb)
next

sub moveObj(o as tObj, moveby as tV3) as long
o.px += moveby.x
o.py += moveby.y
o.pz += moveby.z
end sub

ErosOlmi
28-06-2007, 21:36
Ken,

sure is that thinBasic has not pointers to functions and have no real pointers with dereferencing abilities so far.

Regarding UDTs they are structures but can also be considered as memory buffers so an UDT can be used in any place where a string is used even if not very efficient.
For example


type tRGB
r as long
g as long
b as long
end type

dim MyString as string
dim MyRGB as tRGB

'---Assign some values and show
MyRGB.r = 255
MyRGB.g = 0
MyRGB.b = 255
msgbox 0, "Color is: " & MyRGB.r & " " & MyRGB.g & " " & MyRGB.b

'---Save UDT into a string buffer
MyString = MyRGB

'---Clean UDT
MyRGB.r = 0
MyRGB.g = 0
MyRGB.b = 0
msgbox 0, "Now Color is: " & MyRGB.r & " " & MyRGB.g & " " & MyRGB.b

'---Get back UDT values directly from the saved buffer
MyRGB = MyString
msgbox 0, " Back to Color: " & MyRGB.r & " " & MyRGB.g & " " & MyRGB.b



In any case, interesting questions but I need to check a bit of options ...
I will give you back.

Eros

kryton9
28-06-2007, 23:54
Eros this is very interesting thanks.

THen could we do this?



type tObject
r as long
g as long
b as long
x as double
y as double
z as double
end type

type tRGB
r as long
g as long
b as long
end type

dim Red as string
dim MyRGB as tRGB
dim object as tObject

'---Assign some values and show
MyRGB.r = 255
MyRGB.g = 0
MyRGB.b = 0

Red = MyRGB
setColorObject(Red)

sub setColorObject( Color as tRGB )
object.r = color.r
object.g = color.g
object.b = color.b
end sub

kryton9
28-06-2007, 23:56
I am excited that we can use UDT's in Linked Lists. Do we use them as UDT's or do we have to save them as a string? Thanks for the clarification.