• Welcome to Dark Bit Factory & Gravity.
 

3D Twister - Sinus Methods

Started by Clyde, September 10, 2008

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Clyde

#40
Ah ok, so for example:


vc(a)=AddVertex(surface,  x#,y#, z#, 0.0*4 , v#*4*100) : a=a+1
vc(a)=AddVertex(surface, -z#,y#, x#, 0.25*4, v#*4*100) : a=a+1
vc(a)=AddVertex(surface, -x#,y#,-z#, 0.5*4 , v#*4*100) : a=a+1
vc(a)=AddVertex(surface,  z#,y#,-x#, 0.75*4, v#*4*100) : a=a+1
vc(a)=AddVertex(surface,  x#,y#,z#,  1.0*4, v#*4*100) : a=a+1


Edit- tried that, but still having problems with the texture not working properly against the V.
I have tried, v*(4*Height), v*4*Height, v+(4*Height). Height being 100.0 or 256.0

I dont suppose it has anything to do with the v co-ords being worked out like this: v#= Float ( i ) / Float ( segs )


Cheers and many thanks,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

hellfire

When multiplying your v-coordinate by 400, the texture will tile 400 times along the height of your object, so it's squeezed into only a few pixels height - better try 10 or 20.
You should really try to understand the effect of scaling texture-coordinates as this is an elementary concept.
Challenge Trophies Won:

Clyde

Ok cheers for that Hellfire dude.

I thought that there might be some kind of math for calculating the correct scale for the texture co-ords, as I have done quite a bit of mesh making and experimenting in B3D. I thought there might be a bit of math to use in the u and v's.

Its sorted now in that area, which is nice and thankyou.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

hellfire

#43
QuoteI thought that there might be some kind of math for calculating the correct scale for the texture co-ords
You can scale, scroll or rotate your texture-coordinates how you like and all these can have an useful application or desired effect.
Generally you want to keep the aspect-ratio of your texture. In this case you align the width of your texture to fill one side of the cuboid (the edge length is 1). Since the texture is 4x as high as wide and the cuboid has a height of 100 you would scale your v-coordinate into a range of 0..25 (100/4) to keep the texture's aspect ratio.
Challenge Trophies Won: