Canalblog
Suivre ce blog Administration + Créer mon blog
Publicité

3d réalisation

3d réalisation
Derniers commentaires
Visiteurs
Depuis la création 14 264
10 février 2019

calcul point longueur courbe dans blender ( juste pour moi)

mon objectif calculer longeur et point(x,y,z) d'un path pour faire déplacer via un script un objet sur ce path

mesurer longueur path: select votre path puis aller onglet script et dans la console mettre

bpy.context.object.data.splines.active.calc_length(resolution=0)

attention votre path doit pas etre scalé( faire un apply scale)

http://www.f-legrand.fr/scidoc/docmml/graphie/geometrie/bezier/bezier.html

http://www.f-legrand.fr/scidoc/srcdoc/graphie/geometrie/bezier/bezier-pdf.pdf

https://blender.stackexchange.com/questions/47926/get-length-of-bezier-curve-with-python-for-driver

https://blender.stackexchange.com/questions/93434/animation-nodes-setup-not-updating-when-rendering

https://squircleart.github.io/animation-nodes/the-essense-of-animation-nodes-preface.html

 https://docs.blender.org/api/2.70/mathutils.html

https://blenderartists.org/t/how-to-work-out-object-speed-in-game/507123/4

https://sd-5.archive-host.com/membres/up/34b7c9d586a62f04d502ed17cecc18c0aaaa725e/noel/htmlcsscanvas/jncouropenclassroom/javascriptplacementdivetcalculepathetcanvasetetincelle.js

https://blender.stackexchange.com/questions/73630/animate-curves-by-changing-spline-data-using-a-python-script

https://blenderartists.org/t/use-of-foreach-get-and-foreach-set/524646

 https://blender.stackexchange.com/questions/27465/running-a-script-for-each-frame

https://blender.stackexchange.com/questions/66293/how-to-make-python-script-check-some-value-every-frame

https://docs.blender.org/manual/fr/dev/editors/python_console.html

obj.data.splines[...].length

bpy.context.scene.objects.active = bpy.data.objects['Sphere.017']
import bpy
from mathutils import *
from bpy.props import *


#distance between 2 points
def dist(p1, p2):
 return (p2-p1).magnitude


#cuadratic bezier value
def quad(p, t):
 return p[0]*(1.0-t)**2.0 + 2.0*t*p[1]*(1.0-t) + p[2]*t**2.0



#cubic bezier value
def cubic(p, t):
 return p[0]*(1.0-t)**3.0+3.0*p[1]*t*(1.0-t)**2.0+3.0*p[2]*(t**2.0)*(1.0-t)+p[3]*t**3.0




def calct(obj, t):
 mw = obj.matrix_world
 spl = obj.data.splines.active
 points = spl.bezier_points
 nsegs =len(points)-1
 d = 1.0/nsegs
 seg = int(t/d)
 t1 = t/d - int(t/d)
 if t==1:
  seg-=1
  t1 = 1.0
 p = getbezpoints(spl,mw, seg)
 coord = cubic(p, t1)
 print(coord)
 return coord
 

#gets a bezier segment's control points on global coordinates
def getbezpoints(spl, mt, seg=0):
 points = spl.bezier_points
 p0 = mt @ points[seg].co
 p1 = mt @ points[seg].handle_right
 p2 = mt @ points[seg+1].handle_left
 p3 = mt @ points[seg+1].co
 return p0, p1, p2, p3

obj=bpy.data.objects['BezierCircle']
#bpy.context.scene.objects.active = bpy.data.objects['Sphere.017']
#obj1=bpy.data.objects['Cube']
 
obj.location.x += 1.0

bpy.context.object.location[0] = 0
bpy.context.object.location[1] = 0
bpy.context.object.location[2] = 0
bpy.ops.object.select_all(action='SELECT')


length = 0.0
prec = 1000 #precision
inc = 1/prec #increments
for i in range(0, prec):
 ti = i*inc
 tf = (i+1)*inc
 a = calct(obj, ti)
 print(a)
 b = calct(obj, tf)
 print(b)
 r = (b-a).magnitude
 length+=r

print(length)

 

https://snakify.org/fr/lessons/two_dimensional_lists_arrays/

 

Publicité
Publicité
8 février 2019

liens modélisation voitures(camion engin chantier....)(juste pour moi)

6 février 2019

tuto mon robot(juste pour moi)

6 février 2019

tuto mon train

j'en suis la je compte faire un modele low poly et un modele euh moyen poly

I:creer un chemin de déplacement

1/add curve circle edit mode segment subdivide(3)

2/selectionner moitie gauche ( sauf point moitié) deplacer x =-5 idem moitie droite x=+5 ensuite rectifier legerement avec y point controle m-1 et m+1

puis select moitier gauche( sauf point milieu et faire move z +5 puis regler point controle point milieu pour avoir joli courbe

3/une fois courbe fini mesurer sa longeur :

How to measure the curve length without plugins<>animation node

select the curve go to scripting tab  dans la console mettre obj.data.splines.active.calc_length(resolution=0)

 

II:déplacer un objet le long curve

https://theduckcow.com/dev/blender/

porte du train:

https://blender.stackexchange.com/questions/9355/is-it-possible-to-animate-a-meshs-geometry-without-using-shape-keys

 

5 février 2019

train

Publicité
Publicité
25 janvier 2019

pour inspiration scene low poly

26 décembre 2018

image-3d-photos-animees-comme-harry-potter-deviennent-realite

8 octobre 2018

prix d'une animation 3d

How much does animation cost to make?

Estimate the cost of animation projects for different mediums, styles, quality and duration using our interactive instant animation price calculator. Use this price guide to calculate a ballpark figure for your next animation project.

http://getwrightonit.com/animation-price-guide/

28 juin 2018

liens divers réalité augmentée

20 juin 2018

casque oculus go

Publicité
Publicité
<< < 10 11 12 13 14 15 16 17 18 19 20 30 > >>
Publicité
Archives
3d réalisation
Publicité