Jump to content

knot13yet

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About knot13yet

  • Birthday 06/13/1975

Contact Methods

  • Website URL
    http://061375.com

Profile Information

  • Gender
    Male
  • Location
    USA

knot13yet's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. function get3Dfaces($data) { $result = array(); foreach($data['faces'] as $key => $value) { if(0 != $key) { $value = ltrim($value); $value = rtrim($value); $string=$value; $face_length = substr($string,0,strpos($string,' ')); $regex=',(?x) (?(DEFINE)(?<Cap>\((?>[^)]+\)))) (?>(?:-?\d\s){4}\([ ]) '; for($i=0; $i<$face_length; $i++) { $regex.='((?&Cap))\s'; } $regex.=','; if(preg_match($regex,$string,$match)) { $result[] = $match; } } } return $result; }
  2. Just Tested Works perfect !!! :D :D
  3. BTW will this handle larger numbers? (100 200) etc... Thanks
  4. Thank you. I will read your post on DEFINE... Although from what I see so far it might as well be in Chinese I will probably be a regular poster here n the near future. REGEXP are one area I absolutely need to learn, but as yet, still allude me. Thanks Again!!!!
  5. I hate rexep(s) so far... I simply need to get these 3 or 4 or 5 or ... sets of numbers example: (0 0) (4 4) (6 6) (2 2) From this: 4 4 0 -1 ( (0 0) (4 4) (6 6) (2 2) ) 4 4 0 -1 ( (0 0) (4 4) (6 6) (2 2) ) 4 4 0 -1 ( (1 1) (3 3) (7 7) (5 5) ) 4 4 0 -1 ( (0 0) (2 2) (3 3) (1 1) ) 4 4 0 -1 ( (4 4) (5 5) (7 7) (6 6) ) 4 4 0 -1 ( (2 2) (6 6) (7 7) (3 3) ) 4 4 0 -1 ( (0 0) (1 1) (5 5) (4 4) ) These are faces of an Anim8or 3D model. I am importing the file and handling the data in PHP then displaying it in HTML5/jQuery. The jQuery bit works great. The first 4 is number of faces... If that's any help. And it can ary based on the number of faces in the mesh. The next 3 digits are likely for UV ( dunno ), don't need them yet. This corresponds to arrays in my jquery later that specify the lines. psuedocode for that might be... face[0] = points[0][x,y,z]; face[4] = points[4][x,y,z]; etc... I think this STARTS to handle it... but not sure what to do next \((?=\d) // any parenthesis that is followed by a digit... But not I need to pipe in the space. do I use a pipe like in cmdl unix? \((?=\d|\s|?=\d)^ Something like that? Am I even in the right ballpark? Here is a link to the HTML part of the code. http://061375.com/html5/canvas_3dwireframe_simplecube.html Thanks for any help in advance.
  6. Man, this seemed easy when I started it. OK.,. so I made a simple procedure on a virtual server: something like DELIMITER // CREATE PROCEDURE GetAllProducts() BEGIN SELECT * FROM products; END // DELIMITER ; It failed in phpMyAdmin, research said this was common.. ok So I tried it in Workbench.. failed with a security error. ... not a big deal... Tried it with HeidiSQL.. "Passed" .. cool the procedure works. So lets put it into a PHP file. empty... no error... just no return. $sql = 'call GetAllProducts'; $result = $db->query($sql); // call to data class while($row = $db->getAsoc) { print_r($row); } the data class is sound.. works every time... I think........
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.