• Increase font size
  • Default font size
  • Decrease font size
Welcome, Guest
Username Password: Remember me

Objects & Properties
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Objects & Properties

Objects & Properties 6 years, 6 months ago #505

May I say first, I'm very impressed with Physion, & everyone's efforts!
I started by looking under the hood at flash-games, utilizing physics, and
found out about the 'Box2D' action-script 'includes'. Started researching Box2D
and found out about Qt/QtScript, and then found out about Physion... and have
not bothered to go back since!!! (More questions on that scenario later though...)

Anyway... I'm used to OOP software like VB, & Delphi, and although Physion is a
much more simple interface, I like the 'standard' Properties window. At the moment,
you can only select an object on screen, with the mouse, to access the Properties.
As I'm now creating complex layered objects, one can be 'lost' behind others. Short
of moving the front item, or changing possibly lots of z-orders, in other software you
can also select the objects from an 'OBJECT' list, and then access the Properties.
This would be a great inclusion, greatly helped if, (and I usually make a habit of it),
the objects are renamed to meaningful names! (Typical user-problem).

I found also, that adjusting an objects 'Opacity' property to zero, (I do it often
when I don't want a Spring, or a Prismatic-Joint visible, to hide the workings),
also meaans you can never select the object again! An Onject-List would fix this.

I found out myself, (before finding it somewhere on your forum/tuition), that the
'.scene' files are zipped, containing the scene icon, and an .XML file. Great!
Within the .XML files, relating to a Polygon object for example, there are long
HEX strings used. ('GeometryString' is easy, and makes sense, and using that).
These hex strings don't seem to be 'normal' (what ever that is) Hex-String to
Binary/Byte arrays. ('Brush', 'Background', 'VisibleSceneRect' headers).
Can I know the conversion algos, or is that private knowledge?
With the 'Parser' I'm trying to create, it would be very handy.

In view of question 2, it would be nice to be able to save individual elements or
objects from a scene, (not simple circles & boxes), to use as a repository to
import into an existing scene. Your program has an 'Evaluate Script' option,
but I guess what I'm trying to do is do the REVERSE, and save as a script.

Thanks again to all. (See 'User Creations' / 'Improved graphics samples'
to see the sort of objects I'm referring to, or wanting to save).
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: Objects & Properties 6 years, 6 months ago #509

  • Lynxx
  • Gold Boarder
  • Java/C#-Developer
  • Posts: 223
1.) Done, look here.
2.) Seen that myself, but don't know the format. But should be easy to find out, for example create some rectangles with Brush #111111 Pattern solid, next one with Brush #222222 Pattern Dense1, next one with Brush #333333 different Horizontal scale ... or wait till admin responses.
3.) Interesting idea .. will think about that.
Infinity is vast, especially near end.
bye, Lynxx

Re: Objects & Properties 6 years, 6 months ago #510

Point 1.
Great! I will check it out shortly. I knew others would have thought of it.

Point 2.
Have tried that, and I sussed out a lot of it, but then came up against a wall.
Interestingly, if you have a texture applied to an object, (256x256 pixels), this
is ALSO embedded in the 'Brush' hex-string, adding 65,500 hex characters! there!
In the .XML file, the string is 'invisible', but selecting it brings it up.

Thanks for your reply.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: Objects & Properties 6 years, 6 months ago #532

  • Dimitris
  • Administrator
  • Posts: 218
1.) Done, look here.
No comment

This long hex string you're seeing is the QBrush of each item saved as a hex string.
Can I know the conversion algos, or is that private knowledge?
It's not a private knowledge at all! This is the piece of C++ code which is used in Physion to write the QBrush in the scene file:
	QByteArray	byteArray;
QDataStream dataStream(&byteArray, QIODevice::WriteOnly);
dataStream << brush;
return QString(byteArray.toHex()); //<-- This one gets saved in the file

OF COURSE this is a silly and inefficient way of writing brushes. For example if you decide to use the same texture twice, it will be written twice in the scene file thus increasing the file size without any good reason. This is a MAJOR TODO for me: i.e. tweak the format of the scene file starting from removing the QBrush redundancy. The only problem with this is that a backward compatibility should be maintained which makes things a little bit more complicated.

Yes. It would be nice to be able to save a collections of objects as block which can then be imported back to the scene.
Last Edit: 6 years, 6 months ago by Dimitris.

Re: Objects & Properties 6 years, 6 months ago #535

I think I mis-worded what I meant by 'private'. I certainly wouldn't deliberately offend.
What I meant was that I thought it might be some special custom-coding for your app.
I understand what you mean now, and slowly coming to grips with it.
Feeling a bit rough with the flu now, so my brain is not engaged fully!
Thank you for your responses. Am most impressed.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !

Re: Objects & Properties 6 years, 6 months ago #536

Hi Lynxx. Just noticed a strange side-effect with your Object-List module.
For some reason, once your module is running, when you create on screen with
the mouse, a new rectangle, you can't see the 'box' while dragging it's size.
You only see it after releasing the mouse, and then it's there.
1x1 square diag = root-2. Cube diag = root-3. Beautiful !
  • Page:
  • 1
  • 2
Moderators: Glenn555
Time to create page: 0.15 seconds