Crystal Space
Welcome,
Guest
. Please
login
or
register
.
June 19, 2013, 08:24:25 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
9261
Posts in
2262
Topics by
5443
Members
Latest Member:
Michealclark
Crystal Space
Crystal Space Development
Support
Planar texture mapping
« previous
next »
Pages:
[
1
]
Author
Topic: Planar texture mapping (Read 1316 times)
eventhorizon5
Jr. Member
Posts: 53
Planar texture mapping
«
on:
December 26, 2009, 06:32:47 am »
Hi,
I've recently been working on trying to implement generic planar texture mapping for objects in my simulator, and am wondering if anyone here knows the right way to do it (the way I originally did it was very wrong).
Basically I'm trying to take a polygon of any shape (and any direction), and calculate a square around the polygon to use as the texture mapping coordinates. My original way was to calculate the extents of the polygon (min and max vertex values) and use that to construct the square's coordinates (with X and Z flipping based on the direction of normals), but obvious problems start happening when the Y portion of the normal vector is not 0 (since the extents no longer correlate with the plane that the polygon's on), so now I'm trying to figure out if I could use the polygon's plane to determine the planar corners (top left, top right, bottom right). Has anyone tried doing things like this? Thanks
-eventhorizon
Logged
res
Develazyoper
CS Developer
Full Member
Posts: 206
Re: Planar texture mapping
«
Reply #1 on:
December 28, 2009, 05:21:07 pm »
Lighter2 has to solve the same problem (there for mapping lightmaps); what it does is to take the largest component of the normal of a polygon and using the _other_ two components for the projection.
Logged
eventhorizon5
Jr. Member
Posts: 53
Re: Planar texture mapping
«
Reply #2 on:
December 29, 2009, 04:34:30 pm »
Quote from: res on December 28, 2009, 05:21:07 pm
Lighter2 has to solve the same problem (there for mapping lightmaps); what it does is to take the largest component of the normal of a polygon and using the _other_ two components for the projection.
Thanks - that seems to have worked.
-eventhorizon
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Crystal Space Development
-----------------------------
=> General Crystal Space Discussion
=> Support
-----------------------------
Crystal Space Project Development
-----------------------------
=> Feature Requests
=> Plugins
=> Bug Reports
-----------------------------
Crystal Space Development
-----------------------------
=> Game Content Creation
-----------------------------
Miscellaneous
-----------------------------
=> Article/Tutorial Requests
=> Article/Tutorial Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Development Discussion
-----------------------------
Crystal Space Projects
-----------------------------
=> Project Discussion
=> WIP Projects
=> Finished Projects
-----------------------------
Associate Projects
-----------------------------
=> CEL Discussion
=> Crystal Core Discussion
=> CrystalBlend Discussion
-----------------------------
Crystal Space Project Development
-----------------------------
=> Google Summer of Code
-----------------------------
Associate Projects
-----------------------------
=> Apricot (Open Game)
=> Ares Project
Loading...