Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Object Grpahic and vertices problem
- - By Kandif [pl] Date 2014-11-19 17:25 Edited 2014-11-19 17:28
I want to create a quite big object(for test), size: 32x32. But i have problem with vertices, Docs describe too less about that.

DefCore:

[DefCore]
id=Name
Version=5,3,2,0
Category=C4D_Object
Width=32
Height=32
Offset=-16,-16
Vertices=8
VertexX=-32,-16,0,16,32,-16,0,16,
VertexY=0,16,32,16,0,-16,-32,-16
VertexFriction=20,20,20,20,20,20,20,20
Value=1
Mass=10
Components=Name=1
Projectile=1
Rotate=1

I want 8 vertices like on the image:

The Object is spherical.

The name of file is: Graphics.2.png . I noticed that when I changed number "2" the size of Graphic is also changed, why ?
Parent - - By Armin [de] Date 2014-11-19 18:20 Edited 2014-11-19 18:22
The x in Graphics.x.png specifies the value by which the width / height of the ingame graphic is scaled down. E.g.: The original loam object has a width and height of 8 but the graphic file is called Graphic.8.png. That means the width / height of the graphic should be 8 times bigger than 8. -> Graphic contains 64x64pixels.

You can name your graphic Graphics.png and make it 32x32 pixels big. But then it would look blurry when you zoom in. So the point is that you can define the resolution / detail lvl.
Parent - - By Kandif [pl] Date 2014-11-19 18:42
But how i should set: Offset,VertexX,VertexY ?
Parent - By Pyrit Date 2014-11-19 19:01
They are relative to the offset. (offset is the middle of the object in most cases and in yourse)

Relative to the offset means that you have to start counting in the middle.

-X goes left. +X goes right. -Y goes up. Y goes down.

The vertex on the faaaaaar left would be

VertexX=-16
VertexY=0


from the middle this goes 16 to the left and 0 up/down.

Adding a second vertex at the very bottom would look like

VertexX=-16,0
VertexY=0,16


So you always add one pair of X and Y coordinates.

For the ones in the middle you have to do some math to get how many pixels you have to go vertically and horizontally ;)
Parent - - By Newton [de] Date 2014-11-19 21:45

>VertexX=-32,-16,0,16,32,-16,0,16,
>VertexY=0,16,32,16,0,-16,-32,-16
>VertexFriction=20,20,20,20,20,20,20,20


Looks fine to me, except that there is a "," as the last character in the first line that doesn't belong there. What exactly does not work with the vertices?
Parent - - By Kandif [pl] Date 2014-11-20 15:08
OK, It works now:

Width=32
Height=32
Offset=-16,-16
Vertices=8
VertexX=-16,-8,0,8,16,-8,0,8,0
VertexY=0,8,16,8,0,-8,-16,-8,0
VertexFriction=40,40,40,40,40,40,40,40

It doesn't works how i want. Its only collides when one of the vertices touch the landscape or another object. But i want to collide complete object, not only parts of it.

So i'm going to use SolidMask. Now I dont understand how to set it in DefCore (6 integers, I think it should be 4).
Parent - By Clonkonaut [de] Date 2014-11-20 17:15
Yeah, that's what vertices are: Collision points with the landscape, not defining a collision polygon or similar.

The last two int for SolidMask are offset to the object. First four are position in the graphics file (x,y) and width, height.
Reply
Up Topic General / Help and Questions / Object Grpahic and vertices problem

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill