Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: 1 2 [3] 4

Author Topic: Anim8or 3D Viewer  (Read 17274 times)

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Anim8or 3D Viewer
« Reply #30 on: May 02, 2014, 11:59:40 pm »

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...
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Anim8or 3D Viewer
« Reply #31 on: May 04, 2014, 10:10:52 pm »

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: [Select]
[asl title="optional"]ASL Script[/asl]
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: [Select]
[attach]1[/attach]

ASL code snippet:
Code: [Select]
[asl]ASL Text (not shown in full here)[/asl]
ASL Snippet
  1. /**
  2.  * @author Randall Bezant (aka Raxx)
  3.  * @attribution "Fast, Minimum Storage Ray/Triangle Intersection" by Tomas Moller and Ben Trumbore:
  4.  * http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf
  5.  *
  6.  * @param <point3> $v0, $v1, $v2 - The three points of the colliding triangle in clockwise direction
  7.  * @param <point3> $rSource - Ray source point
  8.  * @param <point3> $rDir - Ray Direction
  9.  *
  10.  * @return point2 - If collision, returns the length along the ray direction (known as t),
  11.  * and collided indicator of 1 for a value of (1, t). Otherwise returns (0, 0). If t is negative,
  12.  * that means it collided in the opposite direction of the specified ray direction, behind the
  13.  * ray source.
  14.  *
  15.  * Single-sided ray/triangle intersection method. To get the point of intersection on the triangle,
  16.  * use this formula:
  17.  *
  18.  * pI = p + t*d
  19.  *
  20.  * pI: Point of intersection (point3)
  21.  * p: Ray source (point3)
  22.  * t: length along ray (float)
  23.  * d: Ray direction (point3)
  24.  *
  25. */
  26. point2 $rayTriangleIntersect (point3 $V0, point3 $V1, point3 $V2, point3 $rSource, point3 $rDir)
  27. {
  28. // Determinant
  29. point3 $pvec, $tvec, $qvec, $edge1, $edge2;
  30. float $determinant, $triangleV, $triangleU;
  31.  
  32. $edge1 = $V1 - $V0;
  33. $edge2 = $V2 - $V0;
  34.  
  35. $pvec = cross($rDir, $edge2);
  36. $determinant = dot($edge1, $pvec);
  37.  
  38. if ($determinant < 0.000001)
  39. return (0,0);
  40.  
  41. $tvec = $rSource - $V0;
  42. $triangleU = dot($tvec, $pvec);
  43.  
  44. if($triangleU < 0.0 || $triangleU > $determinant)
  45. return (0,0);
  46.  
  47. $qvec = cross($tvec, $edge1);
  48. $triangleV = dot($rDir, $qvec);
  49.  
  50. if ($triangleV < 0.0 || $triangleU + $triangleV > $determinant)
  51. return (0,0);
  52.  
  53. return (1, dot($edge2, $qvec) / $determinant);
  54.  
  55. }


« Last Edit: May 06, 2014, 05:20:54 pm by Raxx »
Logged

ianross

  • Full Member
  • ***
  • Posts: 141
  • Imagination is the elixir of life.
    • View Profile
    • https://www.tradebit.com/filedetail.php/164976574-part-1-anim8or-tutor-course
Re: Anim8or 3D Viewer
« Reply #32 on: May 06, 2014, 04:48:42 pm »

This is great!!!
Logged

siragin

  • Full Member
  • ***
  • Posts: 196
    • View Profile
    • Shatalu Productions
Re: Anim8or 3D Viewer
« Reply #33 on: July 12, 2014, 10:30:11 pm »

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.
Logged

Deepthought

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Anim8or 3D Viewer
« Reply #34 on: July 23, 2014, 11:58:44 pm »

*jaw drops*
can it display figures or play sequences?
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Anim8or 3D Viewer
« Reply #35 on: July 25, 2014, 07:57:55 pm »

siragin, what's your approach? The three.js source code has plenty of examples in all areas that you can use, along with its API documentation.

Deepthought, no figures, sequences, or scenes just yet. I've decided to wait and see where Steve takes it before I begin implementation in those areas.
Logged

siragin

  • Full Member
  • ***
  • Posts: 196
    • View Profile
    • Shatalu Productions
Re: Anim8or 3D Viewer
« Reply #36 on: July 28, 2014, 09:57:49 pm »

I'm looking for a basic obj loader that has a transparent background so I can use the background from the website it will be on. I have tried to study the examples that comes with the three.js source code, butI only have gotten as far as loading the model. The camera is too close to the model or the model is too big. I only know how to import one full model. An obj with multiple mesh will not show all of the mesh just one. There is no lights of environment in the scene. Even if I copy a light setup from an example it will not display. They must all be code dependent. Plus my model has not texture.
Logged

MvGulik

  • Full Member
  • ***
  • Posts: 107
  • [... Lost in Space ...]
    • View Profile
Re: Anim8or 3D Viewer
« Reply #37 on: October 21, 2014, 01:18:14 pm »

A option the stop the model rendering would not be a bad addition.
- As it can be a bit CPU heavy at times (for some).
- Rendering currently persists when the render-box is off screen.
* Reloading a page works, but its not really a nice workaround.

Other than that, its a nice forum feature. :)
Logged

johnar

  • Sr. Member
  • ****
  • Posts: 812
  • Make it, Move it--Give it Life
    • View Profile
    • youtube vids
Re: Anim8or 3D Viewer
« Reply #38 on: October 21, 2014, 11:42:04 pm »

Good point MvGulik.
 Very relevant in my case. Its not the time thing so much for me, but the data usage. (expensive data prices here)
 I used to turn images off in web browser, but thats a bit of a shame.
 It would be nice to have a better option for stopping rendering.
 Also agree that its a nice forum feature. (really cool actually. Thumbs up Raxx)
Logged
%

kreator

  • Hero Member
  • *****
  • Posts: 1113
  • Anim8or, Blender, & Carrara. A Great Combination!
    • View Profile
    • Anim8orWorld
Re: Anim8or 3D Viewer
« Reply #39 on: December 05, 2014, 07:33:56 am »

CrashDrive:
 If you look at earlier posts The host has limited uploads to 2 meg I don`t know if it was resolved later
Logged
O

civic71

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Anim8or 3D Viewer
« Reply #40 on: March 09, 2015, 12:04:38 pm »

Fantastic
Logged

civic71

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Anim8or 3D Viewer
« Reply #41 on: March 09, 2015, 05:04:01 pm »

test pepita

Logged

civic71

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Anim8or 3D Viewer
« Reply #42 on: December 25, 2015, 10:41:43 pm »

Hi, this topic introduced me to Three.js and for this I thank Raxx.
After several tests with Three.js I realized a 2d game .

Then I wanted to try the files an8, having Anim8or 3D Viewer modified slightly, to better understand how it worked.
Here I made for Christmas this demo of a mini crib :http://gamequiz.altervista.org/files/html5/Presepio/index.php?Text=Anim8or.com

Now I hope that Raxx, may in the future implement animations :)
Greetings and Merry Christmas
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Anim8or 3D Viewer
« Reply #43 on: December 26, 2015, 01:30:00 am »

civic71, very cool nativity scene, and happy Holidays!

I'm surprised you were able to utilize it for the demo, good job! As for animation, we'll see ;)
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1523
    • View Profile
Re: Anim8or 3D Viewer
« Reply #44 on: December 26, 2015, 02:49:14 am »

Yes,nice nativity scene.  Thanks for the timely post :-)
Logged
Pages: 1 2 [3] 4