Author Topic: 3D Twister - Sinus Methods  (Read 16774 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: 3D Twister - Sinus Methods
« Reply #40 on: September 26, 2008 »
Ah ok, so for example:

Code: [Select]
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.
« Last Edit: September 27, 2008 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 3D Twister - Sinus Methods
« Reply #41 on: September 28, 2008 »
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: 3D Twister - Sinus Methods
« Reply #42 on: September 29, 2008 »
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:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: 3D Twister - Sinus Methods
« Reply #43 on: September 30, 2008 »
Quote
I 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.
« Last Edit: September 30, 2008 by hellfire »
Challenge Trophies Won: