General Category > General Anim8or Forum

Anim8or 3D Viewer

<< < (7/10) > >>

Raxx:
CrashDrive, glad it works! Rock (the dog) is an old character I made for a mobile game that didn't make it. Sadly, none of it's new. I'm hoping to be able to put up some fresh work later though :)

davdud101, thanks!

I'm working on animation for the 3D viewer now, we'll see how far I get with it...

Raxx:
Alright, so I decided to flesh out some of the other viewer elements first.

Firstly, I added .a8s embedded support. What this does is embed the contents of a .a8s file directly within the post with syntax highlighting.

I also added the asl tags so that you can embed ASL just by copying and pasting into those tags. The syntax would be

--- Code: ---[asl title="optional"]ASL Script[/asl]
--- End code ---

If a title isn't given, "ASL Snippet" is used instead. Please note that the syntax highlighter isn't very mature yet, and will be fleshed out over time.

Finally, I added options for the video attachments. You can now set to enable/disable the controls, autoplay, or loop.

Related to that, I'm replacing "an8={}" for the more universal "options={}". Please use that instead (first post will be updated to reflect this).

Examples
.a8s Attachment:

--- Code: ---[attach]1[/attach]
--- End code ---


ASL code snippet:

--- Code: ---[asl]ASL Text (not shown in full here)[/asl]
--- End code ---

function selectText(containerid){if(document.selection){var range = document.body.createTextRange();range.moveToElementText(document.getElementById(containerid));range.select();}else if (window.getSelection){var range = document.createRange();range.selectNode(document.getElementById(containerid));window.getSelection().removeAllRanges();window.getSelection().addRange(range);}}ASL Snippet/** * @author Randall Bezant (aka Raxx) * @attribution "Fast, Minimum Storage Ray/Triangle Intersection" by Tomas Moller and Ben Trumbore: * http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf *  * @param <point3> $v0, $v1, $v2 - The three points of the colliding triangle in clockwise direction * @param <point3> $rSource - Ray source point * @param <point3> $rDir - Ray Direction * * @return point2 - If collision, returns the length along the ray direction (known as t), * and collided indicator of 1 for a value of (1, t). Otherwise returns (0, 0). If t is negative, * that means it collided in the opposite direction of the specified ray direction, behind the * ray source. *  * Single-sided ray/triangle intersection method. To get the point of intersection on the triangle, * use this formula: * * pI = p + t*d * * pI: Point of intersection (point3) * p: Ray source (point3) * t: length along ray (float) * d: Ray direction (point3) **/point2 $rayTriangleIntersect (point3 $V0, point3 $V1, point3 $V2, point3 $rSource, point3 $rDir){ // Determinant point3 $pvec, $tvec, $qvec, $edge1, $edge2; float $determinant, $triangleV, $triangleU;  $edge1 = $V1 - $V0; $edge2 = $V2 - $V0;  $pvec = cross($rDir, $edge2); $determinant = dot($edge1, $pvec);  if ($determinant < 0.000001) return (0,0);  $tvec = $rSource - $V0; $triangleU = dot($tvec, $pvec);  if($triangleU < 0.0 || $triangleU > $determinant) return (0,0);  $qvec = cross($tvec, $edge1); $triangleV = dot($rDir, $qvec);  if ($triangleV < 0.0 || $triangleU + $triangleV > $determinant) return (0,0);  return (1, dot($edge2, $qvec) / $determinant); }

ianross:
This is great!!!

siragin:
Hello, I was hoping that someone would be able to help me create my own 3d viewer. I wanted to make one for my website to show off my 3d models but I can;t get it to work completely just yet. I viewed example codes on the internet and even downloaded the source code. I can get my model to load in the scene but that is about all. I can;t load textures, add light or get the camera movement that I want. Just wanted to know if someone can help me build one. I don't need one with a lot of fancy features. It can be pretty basic.

Deepthought:
*jaw drops*
can it display figures or play sequences?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version