Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,173 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[MED] 'absolute' texture coordinate snapping #370102
05/10/11 23:10
05/10/11 23:10
Joined: Mar 2010
Posts: 75
YellowAfterlife Offline OP
Junior Member
YellowAfterlife  Offline OP
Junior Member

Joined: Mar 2010
Posts: 75
While MED has a number of nice tools and modes that make texture mapping a lot easier, but lacks one really simple one.

Sometimes there is a need to set texture coordinates to one of sevaral grid-snapped values. May it be a converted WED level (tiled texture, for which often only values {0, 0.25, 0.5, .. } are sed), 'perfect' rectangle part of texture, or a low-resolution texture that you later want to use with nofilter entity flag. I've chosen last one as example.

When using 'generate mapping', texture coordinates are often 'irregular', especially if you turn on 'Show Texture Coordinates' (which is still labeled 'Show Texture Coordinaten' by the way):

30.7777...? That's probably a nice number, except this quarter of pixel can be quite noticable when looking at model in preview window and in-game.
Of course, it's often possible to select that single vertex, and just type in the right texture coordinates - and that's what I do most of time. But sometimes there is more than one:

There, you can see that there are multiple vertices with this kind of problem. The fastest solution remains to type in coordinates for 'control' ones manually, and try to snap the rest of vertices to these by either specifying Snap value equal to delta, wielding them (often a bad idea), or typing in coordinates manually.

A similar situation happens with Rotate and Scale tools. There times when you do not need to rotate your vertices by exactly 91.0102 degrees, there are times where scaling selection by {1.974, 2.143} would only hurt your otherwise perfect texture map.

So, the request itself:
Absolute snapping, which could be enabled via bottom 'pop-up' panel.
Principle of work is as simple as:
vX = round(pX / aS) * aS
vY = round(pY / aS) * aS
Where {vX, vY} - new vertex coordinates, {pX, pY} - potential coordinates (as if dragged without snapping), and aS - the snapping value.
So if you have abs. snapping set to 0.5, and drag the point from initial position {0.1, 0.1} to {0.7, 0.7}, it will be snapped to {0.5, 0.5}.

To compare to the snapping avaible (relative?), that seems to work like:
vX = floor(pX / rS) * rS + rX
vY = floor(pY / rS) * rS + rY
rX = oX % rS
rY = oY % rS
Where values are same as above, plus {oX, oY} being the initial texture coordinates, and rS being the relative snapping value.

Hopefully I told my thoughts clear enough.
Thanks in advance.


Unfortunately, I've not worked with 3dGS for a while now, but it was fun
Re: [MED] 'absolute' texture coordinate snapping [Re: YellowAfterlife] #370217
05/11/11 17:25
05/11/11 17:25
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
I know the answers to earlier requests relating MED, and I fairly doubt that there will be applied any new feature to MED other than importing features.

You can set several vertices at a single point, when selecting them at once and scaling them down 'to zero'.

You can set several vertices into a vertical or horizontal row, when selecting them and scaling them down, while the scaling is restricted to vertical or horizontal.

Hope this helps.

EDIT:
Another suggestion:
You could use Atlas mapping with maximal stretch set to zero.
It doesn't manage to set all rectangular faces rectangular on the uv, but at least the most. And for the rest you could use 6-sided Mapping...?

Last edited by Pappenheimer; 05/11/11 17:30.
Re: [MED] 'absolute' texture coordinate snapping [Re: Pappenheimer] #370255
05/11/11 22:05
05/11/11 22:05
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
While scaling them all to zero will give them the same position, it doesn't give them an 'absolute position' which YellowAfterLife was asking for.

Grid snapping is available when moving vertices and polygons on the model but not when moving on UV.

Either allowing position to be edited or grid snapping would be a useful feature (preferably both).


Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1