Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbMakeMemblockFromMesh setting the U and V

Author
Message
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 27th Apr 2013 22:10
I have been manipulating and creating objects by putting the data from dbMakeMemblockFromMesh into a struct. I want to set the uv's so there will be no stretching.

so far I've simply have been setting the
u[0] = x[0] + y[0]
and the
v[0] = z[0] + y[0]
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 28th Apr 2013 02:21
Here is my "project" the darker triangles are the filler and the lighter is what is left of the objects.
Not the point.. the point is that there is a lot of stretching.


.ZIP format

Attachments

Login to view attachments
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 28th Apr 2013 02:22
.RAR format

x y z are the coords for the vertices

u[0] = x[0] + y[0]
and the
v[0] = z[0] + y[0]

Attachments

Login to view attachments
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 2nd May 2013 03:00
It may be because it's quite late over here but I don't quite get what the issue is? Care to clarify?

The UV coordinates are to be entered in the range [0..1]. If you go beyond this range they will wrap around, essentialy using only the decimal part.
As such setting the uv-coordinates to the vertex positions makes it sound like it is probably not what you want to accomplish. Especially considering that the polygons are triangles and not quads.
Again, please define "stretching" and I might be able to assist further


"Why do programmers get Halloween and Christmas mixed up?"
Benjames8
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 4th May 2013 01:01 Edited at: 4th May 2013 18:23


See how the squares are stretched in the left image?

essentially the uv\'s are set to the vertices coordinates making it tile or wrap like you where saying but my specific problem is the stretching of the texture.



//Triplanar Texture

http://www.ogre3d.org/forums/viewtopic.php?f=2&t=61396
[href]http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html
[/href]
Im looking into this \"method\" called triplanar texture projection.
I believe it maps sorta like I am but instead of u=x and v=z it takes three \"projections\" (u=x & v=z , u=x & v=y, u=z & v=y) and then blends them based on the angles of the faces. This is all speculation.

//clamping

I found this site
http://codeflow.org/entries/2010/aug/17/springuv-minimize-distortions-from-planar-uv-mapped-terrain/
I like the idea of clamping more then triplanar projection.
With triplanar projection you rely on a shader.
With clamping its like built into the object.


Look at this picture of a face that has triplanar projection applied to it you can see where the textures blend but don't line up..


Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-18 21:44:42
Your offset time is: 2024-11-18 21:44:42