parent
d066a02b7c
commit
31857276cf
6 changed files with 974 additions and 373 deletions
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,42 @@ |
|||||||
|
#include "../../glm/glm.hpp" // glm::vec3, glm::vec4, glm::ivec4, glm::mat4 |
||||||
|
|
||||||
|
struct triangle |
||||||
|
{ |
||||||
|
glm::vec3 Position[3]; |
||||||
|
glm::vec3 Normal; |
||||||
|
}; |
||||||
|
|
||||||
|
void computeNormal(triangle & Triangle) |
||||||
|
{ |
||||||
|
glm::vec3 const & a = Triangle.Position[0]; |
||||||
|
glm::vec3 const & b = Triangle.Position[1]; |
||||||
|
glm::vec3 const & c = Triangle.Position[2]; |
||||||
|
Triangle.Normal = glm::normalize(glm::cross(c - a, b - a)); |
||||||
|
} |
||||||
|
|
||||||
|
#include "../../glm/gtc/matrix_projection.hpp" // glm::perspective |
||||||
|
#include "../../glm/gtc/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale |
||||||
|
#include "../../glm/gtc/type_ptr.hpp" // glm::value_ptr |
||||||
|
|
||||||
|
glm::vec4 const ClearColor = glm::vec4(glm::vec3(0.0f), 1.0f); |
||||||
|
glm::ivec4 const Viewport = glm::ivec4(0, 0, 640, 480); |
||||||
|
|
||||||
|
void glUniformMatrix4fv(int location, int count, bool transpose, const float * value); |
||||||
|
|
||||||
int main() |
int main() |
||||||
{ |
{ |
||||||
|
//triangle Triangle;
|
||||||
|
//computeNormal(Triangle);
|
||||||
|
|
||||||
|
float Translate = 1.0f; |
||||||
|
glm::vec2 Rotate; |
||||||
|
|
||||||
|
glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); |
||||||
|
glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); |
||||||
|
glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); |
||||||
|
glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); |
||||||
|
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); |
||||||
|
glm::mat4 MVP = Projection * View * Model; |
||||||
|
|
||||||
|
glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); |
||||||
} |
} |
||||||
|
@ -1,140 +1,224 @@ |
|||||||
<?xml version="1.0" encoding="iso-8859-1"?> |
<?xml version="1.0" encoding="iso-8859-1"?> |
||||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
||||||
|
|
||||||
<xsl:strip-space elements="*" /> |
<xsl:strip-space elements="*" /> |
||||||
|
|
||||||
<xsl:output |
<xsl:output |
||||||
method="xml" |
method="xml" |
||||||
media-type="application/xhtml+xml; charset=iso-8859-1" |
media-type="application/xhtml+xml; charset=iso-8859-1" |
||||||
version="1.0" |
version="1.0" |
||||||
encoding="iso-8859-1" |
encoding="iso-8859-1" |
||||||
standalone="no" |
standalone="no" |
||||||
omit-xml-declaration="no" |
omit-xml-declaration="no" |
||||||
doctype-public="-//W3C//DTD XHTML 1.1//EN" |
doctype-public="-//W3C//DTD XHTML 1.1//EN" |
||||||
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" |
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" |
||||||
indent="no" /> |
indent="no" /> |
||||||
|
|
||||||
<xsl:template match="link"> |
<xsl:template match="link"> |
||||||
<a href="{./@href}"><xsl:value-of select="." /></a> |
<a href="{./@href}"><xsl:value-of select="." /></a> |
||||||
</xsl:template> |
</xsl:template> |
||||||
|
|
||||||
<xsl:template match="image"> |
<xsl:template match="image"> |
||||||
<xsl:choose> |
<xsl:choose> |
||||||
<xsl:when test="./@href"> |
<xsl:when test="./@href"> |
||||||
<xsl:element name="a"> |
<xsl:element name="a"> |
||||||
<xsl:attribute name="class">menu-titre2</xsl:attribute> |
<xsl:attribute name="class">menu-titre2</xsl:attribute> |
||||||
<xsl:attribute name="href"><xsl:value-of select="./@href" /></xsl:attribute> |
<xsl:attribute name="href"><xsl:value-of select="./@href" /></xsl:attribute> |
||||||
|
<xsl:element name="img"> |
||||||
|
<xsl:attribute name="src"><xsl:value-of select="@file" /></xsl:attribute> |
||||||
|
<xsl:attribute name="alt"><xsl:value-of select="@file" /></xsl:attribute> |
||||||
|
</xsl:element> |
||||||
|
</xsl:element> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
<xsl:element name="img"> |
<xsl:element name="img"> |
||||||
<xsl:attribute name="src"><xsl:value-of select="@file" /></xsl:attribute> |
<xsl:attribute name="src"><xsl:value-of select="@file" /></xsl:attribute> |
||||||
<xsl:attribute name="alt"><xsl:value-of select="@file" /></xsl:attribute> |
<xsl:attribute name="alt"><xsl:value-of select="@file" /></xsl:attribute> |
||||||
</xsl:element> |
</xsl:element> |
||||||
</xsl:element> |
</xsl:otherwise> |
||||||
</xsl:when> |
</xsl:choose> |
||||||
<xsl:otherwise> |
</xsl:template> |
||||||
<xsl:element name="img"> |
|
||||||
<xsl:attribute name="src"><xsl:value-of select="@file" /></xsl:attribute> |
<xsl:template match="image-list"> |
||||||
<xsl:attribute name="alt"><xsl:value-of select="@file" /></xsl:attribute> |
<div class="news-image"> |
||||||
</xsl:element> |
<xsl:apply-templates select="./image-element" /> |
||||||
</xsl:otherwise> |
</div> |
||||||
</xsl:choose> |
</xsl:template> |
||||||
</xsl:template> |
|
||||||
|
<xsl:template match="image-element"> |
||||||
<xsl:template match="image-list"> |
<a href="{./@normal}"> |
||||||
<div class="news-image"> |
<img src="{./@small}" alt="{./@title}" /> |
||||||
<xsl:apply-templates select="./image-element" /> |
</a> |
||||||
</div> |
</xsl:template> |
||||||
</xsl:template> |
|
||||||
|
<xsl:template match="list"> |
||||||
<xsl:template match="image-element"> |
<xsl:value-of select="./@nom" /><br /> |
||||||
<a href="{./@normal}"> |
<xsl:apply-templates select="./element"/> |
||||||
<img src="{./@small}" alt="{./@title}" /> |
<br /> |
||||||
</a> |
</xsl:template> |
||||||
</xsl:template> |
|
||||||
|
<xsl:template match="element"> |
||||||
<xsl:template match="list"> |
<xsl:apply-templates /><br /> |
||||||
<xsl:value-of select="./@nom" /><br /> |
</xsl:template> |
||||||
<xsl:apply-templates select="./element"/> |
|
||||||
<br /> |
<xsl:template match="paragraph"> |
||||||
</xsl:template> |
<div class="paragraph"><xsl:text /><xsl:apply-templates /><xsl:text /></div><br /> |
||||||
|
</xsl:template> |
||||||
<xsl:template match="element"> |
|
||||||
<xsl:apply-templates /><br /> |
<xsl:template match="about-short"> |
||||||
</xsl:template> |
<div class="title3"> |
||||||
|
<xsl:apply-templates select="./element" /> |
||||||
<xsl:template match="paragraph"> |
</div> |
||||||
<div class="paragraph"><xsl:text /><xsl:apply-templates /><xsl:text /></div><br /> |
<br /> |
||||||
</xsl:template> |
</xsl:template> |
||||||
|
|
||||||
<xsl:template match="about-short"> |
<xsl:template match="source"> |
||||||
<div class="title3"> |
<xsl:value-of select="./@type"/>: <a href="{./@href}"><xsl:value-of select="."/></a><br /> |
||||||
<xsl:apply-templates select="./element" /> |
</xsl:template> |
||||||
</div> |
|
||||||
<br /> |
<xsl:template match="menu"> |
||||||
</xsl:template> |
<div class="menu1"> |
||||||
|
<br /> |
||||||
<xsl:template match="source"> |
<div> |
||||||
<xsl:value-of select="./@type"/>: <a href="{./@adresse}"><xsl:value-of select="."/></a><br /> |
<a href="./goodies/logo1920x1200.png"> |
||||||
</xsl:template> |
<img class="menu-img" src="./common/logo.png" alt="GLM Logo"/> |
||||||
|
</a> |
||||||
<xsl:template match="menu"> |
</div> |
||||||
<div class="menu1"> |
<br /> |
||||||
<br /> |
<div> |
||||||
<div> |
<a class="menu" href="{/glm/downloads/section/download/@link}"> |
||||||
<a href="./goodies/logo1920x1200.png"> |
Download <xsl:value-of select="/glm/downloads/section/download/@name" /> |
||||||
<img class="menu-img" src="./common/logo.png" alt="GLM Logo"/> |
</a> |
||||||
</a> |
</div> |
||||||
</div> |
</div> |
||||||
<br /> |
<br /> |
||||||
<div> |
<xsl:apply-templates select="./menu-group"/> |
||||||
<a class="menu" href="{/glm/downloads/section/download/@link}"> |
<br /> |
||||||
Download <xsl:value-of select="/glm/downloads/section/download/@name" /> |
<xsl:apply-templates select="./menu-link"/> |
||||||
</a> |
<br /> |
||||||
</div> |
<!--div> |
||||||
</div> |
<script type="text/javascript" src="http://feedjit.com/map/?bc=FFFFFF&tc=494949&brd1=FFFFFF&lnk=494949&hc=FF8000&dot=FF8000"></script> |
||||||
<br /> |
<noscript> |
||||||
<xsl:apply-templates select="./menu-group"/> |
<a href="http://feedjit.com/">Feedjit Live Blog Stats</a> |
||||||
<br /> |
</noscript> |
||||||
<xsl:apply-templates select="./menu-link"/> |
</div--> |
||||||
<br /> |
</xsl:template> |
||||||
<!--div> |
|
||||||
<script type="text/javascript" src="http://feedjit.com/map/?bc=FFFFFF&tc=494949&brd1=FFFFFF&lnk=494949&hc=FF8000&dot=FF8000"></script> |
<xsl:template match="menu-pic"> |
||||||
<noscript> |
<div class="menu2"> |
||||||
<a href="http://feedjit.com/">Feedjit Live Blog Stats</a> |
<a href="{@href}"> |
||||||
</noscript> |
<img class="menu-img" src="{@image}" alt="{@name}"/> |
||||||
</div--> |
</a> |
||||||
</xsl:template> |
</div> |
||||||
|
</xsl:template> |
||||||
<xsl:template match="menu-pic"> |
|
||||||
<div class="menu2"> |
<xsl:template match="menu-link"> |
||||||
<a href="{@href}"> |
<xsl:apply-templates select="./menu-pic"/> |
||||||
<img class="menu-img" src="{@image}" alt="{@name}"/> |
</xsl:template> |
||||||
</a> |
|
||||||
</div> |
<xsl:template match="menu-image"> |
||||||
</xsl:template> |
<div class="menu2"> |
||||||
|
<a href="./common/glm.jpg"> |
||||||
<xsl:template match="menu-link"> |
<img class="menu-img" src="./common/logo.jpg" alt="G-Truc"/> |
||||||
<xsl:apply-templates select="./menu-pic"/> |
</a> |
||||||
</xsl:template> |
</div> |
||||||
|
</xsl:template> |
||||||
<xsl:template match="menu-image"> |
|
||||||
<div class="menu2"> |
<xsl:template match="menu-group"> |
||||||
<a href="./common/glm.jpg"> |
<xsl:apply-templates select="./menu-entry"/> |
||||||
<img class="menu-img" src="./common/logo.jpg" alt="G-Truc"/> |
<br /> |
||||||
</a> |
</xsl:template> |
||||||
</div> |
|
||||||
</xsl:template> |
<xsl:template match="menu-entry"> |
||||||
|
<div class="menu2"> |
||||||
<xsl:template match="menu-group"> |
<a href="{./@href}"> |
||||||
<xsl:apply-templates select="./menu-entry"/> |
<xsl:value-of select="./@name"/> |
||||||
<br /> |
</a> |
||||||
</xsl:template> |
</div> |
||||||
|
</xsl:template> |
||||||
<xsl:template match="menu-entry"> |
|
||||||
<div class="menu2"> |
<xsl:template match="code"> |
||||||
<a href="{./@href}"> |
<xsl:choose> |
||||||
<xsl:value-of select="./@name"/> |
<xsl:when test="./@href"> |
||||||
</a> |
<span xmlns="http://www.w3.org/1999/xhtml" class="code-title"> |
||||||
</div> |
<a href="{./@href}"> |
||||||
</xsl:template> |
<xsl:value-of select="./@author" /> |
||||||
|
</a> |
||||||
|
</span> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="code-title"> |
||||||
|
<xsl:value-of select="./@title" /> |
||||||
|
</span> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
<ul xmlns="http://www.w3.org/1999/xhtml" class="code-list"> |
||||||
|
<xsl:apply-templates select="./line" /> |
||||||
|
</ul> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="line"> |
||||||
|
<li xmlns="http://www.w3.org/1999/xhtml" class="code-line"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="@align"> |
||||||
|
<span class="code-line-content" style="padding-left:{@align}"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<span class="code-line-content"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</li> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="progword"> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="./@href"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="progword"> |
||||||
|
<a href="{./@href}"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</a> |
||||||
|
</span> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="progword"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="keyword"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="keyword"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="userword"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="userword"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="codeword"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="codeword"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="string"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="string"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template match="comment"> |
||||||
|
<span xmlns="http://www.w3.org/1999/xhtml" class="comment"> |
||||||
|
<xsl:apply-templates /> |
||||||
|
</span> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
</xsl:stylesheet> |
</xsl:stylesheet> |
||||||
|
Loading…
Reference in New Issue