tiling grass on sphere

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
VasiliiGustelev
Gnoblar
Posts: 23
Joined: Fri May 05, 2006 5:08 pm
Contact:

tiling grass on sphere

Post by VasiliiGustelev »

Hello,

i've opened 3ds max, choozed Sphere primitive, made one, exported it with 3ds-export tool (which i've got from ogre-tools), load it in my application, set material:
material Examples/GrassFloor
{
technique
{
pass
{
texture_unit
{
texture grass_1024.jpg
}
}
}
}

and my sphere is weird. grass is not tiled on it, and looks .. mmm.. sphered.

anybody, help me!

Here how it looks:
Image
pxL
Gremlin
Posts: 158
Joined: Fri Oct 07, 2005 11:48 am
Location: Hilversum, The Netherlands
Contact:

Post by pxL »

It's because of the way the triangles are setup.

2 ways to solve I geus. Either work with the uv map. Or start by making a geospehere (the way the triangle's are build up is different), the second way should be easier :)
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Post by Kojack »

The triangles don't matter (geosphere or other), it's the uv coords that cause that distortion. The sphere in the pic has either spherical or cylindrical mapping, which causes texture distortion at the poles.

Mapping a square of grass to a sphere without some form of distortion is going to be tricky. Squares just don't fit onto spheres, without stretching in some way. Unless your texture already has the reverse of the distortion built in (like when you have a texture of the earth, and the north and south poles look gigantic compared to other continents so they still look ok after the mapping to a sphere shrinks them).
Post Reply